/* BeiSmart / Bei Sahihi — shared stylesheet */
:root {
  --teal: #069494;
  --teal-dark: #057676;
  --pink: #FF69B4;
  --cyan: #00F0FF;
  --white: #FFFFFF;
  --ink: #222222;
  --muted: #5f6b6b;
  --bg: #f4f7f6;
  --line: #dde5e4;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(6, 148, 148, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}

h1 { font-size: 2.2rem; line-height: 1.15; }
h2 { font-size: 1.4rem; margin-bottom: 8px; }
h3 { font-size: 1.1rem; margin-bottom: 10px; }
a { color: var(--teal); }
button { font-family: inherit; cursor: pointer; }

.muted { color: var(--muted); margin-bottom: 14px; }
.hint {
  background: #e8fbfc; border-left: 4px solid var(--cyan);
  padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: .9rem;
}

/* ---------- screens (single-page index.html) ---------- */
.screen { display: none; }
.screen.show { display: block; }
.screen.auth-layout.show,
.screen.app-shell.show { display: grid; }
.page { position: relative; overflow: hidden; min-height: 100vh; }

/* ---------- decorative blobs ---------- */
.blob {
  position: absolute; border-radius: 50%; opacity: .35;
  filter: blur(2px); pointer-events: none; z-index: 0;
}
.blob-cyan { background: var(--cyan); }
.blob-pink { background: var(--pink); }

/* ---------- home / topbar ---------- */
.wrap { position: relative; z-index: 1; max-width: 1050px; margin: 0 auto; padding: 24px 20px 40px; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; flex-wrap: wrap; gap: 12px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; border: none; text-decoration: none;
  font-size: 1.3rem; font-weight: 800; color: var(--teal);
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  box-shadow: 4px 4px 0 var(--pink);
}
.nav-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav-links button, .nav-links a {
  background: none; border: none; font-size: .95rem; font-weight: 600;
  color: var(--ink); padding: 8px 12px; border-radius: 8px; text-decoration: none;
}
.nav-links button:hover, .nav-links a:hover { background: rgba(6,148,148,.1); }
.nav-links .lang-btn, .lang-btn {
  background: var(--cyan); color: var(--ink); font-weight: 800;
  border-radius: 20px; padding: 6px 14px;
}

.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center; margin-bottom: 36px; }
.kicker {
  display: inline-block; background: var(--pink); color: var(--white);
  font-weight: 700; font-size: .8rem; letter-spacing: .5px; text-transform: uppercase;
  padding: 5px 12px; border-radius: 20px; margin-bottom: 14px;
}
.hero p { margin: 14px 0 22px; font-size: 1.05rem; color: var(--muted); max-width: 480px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.step { background: var(--white); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border-top: 4px solid var(--teal); }
.step b { color: var(--pink); }
.footer-note { text-align: center; font-size: .85rem; color: var(--muted); }

/* ---------- market stall illustration ---------- */
.stall { position: relative; height: 280px; max-width: 360px; margin: 0 auto; width: 100%; }
.price-tag {
  position: absolute; top: 0; right: 10px; z-index: 3;
  background: var(--pink); color: var(--white); font-weight: 800;
  padding: 8px 14px; border-radius: 10px; transform: rotate(6deg);
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
}
.stall-roof {
  position: absolute; top: 46px; left: 10px; right: 10px; height: 56px;
  background: repeating-linear-gradient(90deg, var(--teal) 0 36px, var(--cyan) 36px 72px);
  border-radius: 12px 12px 4px 4px; box-shadow: 0 6px 0 rgba(0,0,0,.08);
}
.stall-post { position: absolute; top: 100px; width: 10px; height: 130px; background: #7a5a3a; border-radius: 4px; }
.stall-post.left { left: 28px; }
.stall-post.right { right: 28px; }
.stall-table {
  position: absolute; bottom: 20px; left: 10px; right: 10px; height: 46px;
  background: #a9794b; border-radius: 8px; box-shadow: 0 6px 0 #7a5a3a;
}
.fruit { position: absolute; bottom: 66px; width: 38px; height: 38px; border-radius: 50%; z-index: 2; }
.fruit.one   { left: 50px;  background: #ff5a5f; }
.fruit.two   { left: 100px; background: #ffb400; }
.fruit.three { left: 150px; background: #7ac74f; }
.fruit.four  { left: 200px; background: var(--pink); }
.fruit.five  { left: 250px; background: #ff8a3d; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 2px solid transparent; border-radius: 10px;
  padding: 11px 20px; font-size: .95rem; font-weight: 700; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.15); }
.btn-pink { background: var(--pink); color: var(--white); }
.btn-cyan { background: var(--cyan); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--teal); border-color: var(--teal); }

/* ---------- sign in / sign up ---------- */
.auth-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-art {
  position: relative; overflow: hidden; padding: 40px;
  background: linear-gradient(160deg, var(--teal), var(--teal-dark));
  color: var(--white); display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
.auth-art .brand { color: var(--white); position: absolute; top: 28px; left: 40px; z-index: 1; }
.auth-art h1, .auth-art p { position: relative; z-index: 1; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.auth-form-side .panel { width: 100%; max-width: 420px; }

/* ---------- panels & forms ---------- */
.panel { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
label { display: block; font-weight: 700; font-size: .9rem; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; font-size: 1rem; font-family: inherit;
  border: 1.5px solid #ccd6d5; border-radius: 8px; background: var(--white);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,240,255,.35); }
input[readonly] { background: #eef2f1; color: var(--muted); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.panel p button, .panel p a { background: none; border: none; color: var(--teal); font-weight: 600; text-decoration: underline; font-size: .95rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.error, .success { display: none; padding: 10px 12px; border-radius: 8px; margin: 10px 0; font-size: .92rem; font-weight: 600; }
.error { background: #ffe6ea; color: #b00020; border-left: 4px solid #b00020; }
.success { background: #e0f8ee; color: #087a4a; border-left: 4px solid #087a4a; }
.error.show, .success.show { display: block; }
.error:not(:empty), .success:not(:empty) { display: block; }

/* ---------- logged-in app shell ---------- */
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--teal); color: var(--white); padding: 24px 16px; }
.sidebar .brand { color: var(--white); margin-bottom: 28px; }
.sidebar .brand-mark { box-shadow: 4px 4px 0 var(--pink); }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav a {
  color: var(--white); text-decoration: none; font-weight: 600;
  padding: 10px 14px; border-radius: 10px; transition: background .15s;
}
.side-nav a:hover { background: rgba(255,255,255,.15); }
.side-nav a.active { background: var(--white); color: var(--teal); box-shadow: inset 4px 0 0 var(--pink); }

.main { padding: 28px; overflow-x: hidden; }
.main-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.main-top h1 { font-size: 1.7rem; color: var(--teal); }

.view { display: none; }
.view.show, .view.active { display: block; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--white); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); border-top: 5px solid var(--pink);
}
.stat.teal { border-top-color: var(--teal); }
.stat.cyan { border-top-color: var(--cyan); }
.stat span { display: block; color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat strong { display: block; font-size: 1.6rem; margin-top: 4px; }

/* ---------- calculator result ---------- */
.result-box { background: #f0f9f9; border: 2px solid var(--cyan); border-radius: var(--radius); padding: 16px; margin-top: 20px; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.result-grid span { color: var(--muted); font-size: .85rem; }
.result-grid strong { font-size: 1.3rem; color: var(--teal); }

/* ---------- records table ---------- */
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: .92rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--teal); color: var(--white); white-space: nowrap; }
tbody tr:nth-child(even) { background: #f7fbfb; }
tbody tr:hover { background: #e8fbfc; }
td button { background: var(--pink); color: var(--white); border: none; border-radius: 6px; padding: 5px 10px; font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 800px) {
  h1 { font-size: 1.8rem; }
  .hero, .auth-layout, .app-shell { grid-template-columns: 1fr; }
  .steps, .cards, .result-grid, .row-2 { grid-template-columns: 1fr; }
  .auth-art { min-height: 200px; padding: 80px 24px 30px; }
  .auth-art .brand { left: 24px; }
  .sidebar { padding: 14px; }
  .sidebar .brand { margin-bottom: 12px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 18px; }
}
