/* Midad public website — tokens and components follow Design.md ("Ink & Paper"). */
@font-face { font-family: Plex; src: url(fonts/IBMPlexSansArabic-Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Plex; src: url(fonts/IBMPlexSansArabic-Medium.ttf) format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: Plex; src: url(fonts/IBMPlexSansArabic-SemiBold.ttf) format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: Plex; src: url(fonts/IBMPlexSansArabic-Bold.ttf) format('truetype'); font-weight: 700; font-display: swap; }

:root {
  /* Midad brand: navy #212844 + cream #F0E8D5 (from the logo). */
  --ink-900: #212844; --ink-700: #3A4160; --ink-500: #6B6E80; --ink-300: #A8A6AE;
  --line: #E4DCC8; --paper: #F7F2E7; --paper-2: #F0E8D5; --surface: #FFFDF8;
  --brand: #212844; --brand-hover: #2E3762; --brand-tint: #ECE6D8; --on-brand: #F0E8D5;
  --accent: #F0E8D5; --accent-tint: #F0E8D5; --night: #212844; --on-night: #F0E8D5;
  --success: #2F7A55; --success-tint: #E3EEE5; --warning: #9A6A1F; --warning-tint: #F3E8D2;
  --danger: #B0413E; --danger-tint: #F5E1DC;
  --logo-mark: url(brand/logo-mark-navy.png);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px;
  --shadow-hover: 0 6px 20px rgba(33, 40, 68, .08); --shadow-pop: 0 16px 48px rgba(33, 40, 68, .18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink-900: #F0E8D5; --ink-700: #DDD5C2; --ink-500: #A9A391; --ink-300: #6E6E80;
    --line: #343C5E; --paper: #1A2038; --paper-2: #212844; --surface: #262E4D;
    --brand: #F0E8D5; --brand-hover: #FFF8E6; --brand-tint: #2E3762; --on-brand: #212844;
    --accent-tint: #262E4D; --night: #141a30; --on-night: #F0E8D5;
    --success-tint: #1F3A33; --warning-tint: #3A3226; --danger-tint: #3D2630;
    --success: #7FC3A0; --warning: #E0B46A; --danger: #E7958F;
    --logo-mark: url(brand/logo-mark-cream.png);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink-900);
  font-family: Plex, "Segoe UI", Tahoma, sans-serif; font-size: 15px; line-height: 1.6; font-weight: 500;
}
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
p { margin: 0; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-500); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 719px) { .wrap { padding: 0 16px; } }

/* ---------------------------------------------------------------- header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink-900); font-weight: 700; font-size: 20px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: #212844 url(brand/logo-mark-cream.png) center / 70% no-repeat; flex: none; }
.brand-mark.has-logo { background: none; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name small { font-size: 11px; letter-spacing: 2px; color: var(--ink-500); font-weight: 600; }
.nav { display: flex; gap: 4px; margin-inline-start: 12px; }
.nav a { color: var(--ink-700); padding: 8px 14px; border-radius: 999px; font-weight: 600; }
.nav a:hover { background: var(--paper-2); }
.nav a.active { color: var(--ink-900); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.header-actions { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
.cart-btn { position: relative; }
.cart-count { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.menu-btn { display: none; }
@media (max-width: 899px) {
  .nav { display: none; position: absolute; top: 68px; inset-inline: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 16px; margin: 0; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
  .menu-btn { display: inline-grid; }
  .header-actions .btn-primary { display: none; }
}

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: var(--r-md); border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-dark { background: var(--night); color: var(--on-night); }
.btn-cream { background: #F0E8D5; color: #212844; }
.btn-cream:hover { background: #FFF8E6; }
.btn-secondary { background: var(--surface); color: var(--ink-900); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-300); }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-icon { width: 44px; padding: 0; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon { width: 20px; height: 20px; flex: none; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: stretch; }
.hero-copy { background: var(--accent-tint); border-radius: var(--r-xl); padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 20px; position: relative; overflow: hidden; }
.hero-copy::after { content: ""; position: absolute; width: 300px; height: 380px; background: var(--logo-mark) center / contain no-repeat; opacity: .07; inset-inline-start: -30px; bottom: -60px; pointer-events: none; }
.eyebrow { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--ink-700); }
.hero h1 { font-size: 44px; font-weight: 700; letter-spacing: -.5px; line-height: 1.25; }
.hero p { font-size: 17px; color: var(--ink-700); max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-side { background: var(--night); color: var(--on-night); border-radius: var(--r-xl); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.hero-side h3 { font-size: 18px; }
.hero-logo { width: 120px; height: auto; margin-bottom: 4px; }
.perk { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .06); }
.perk-ico { width: 40px; height: 40px; border-radius: 12px; background: #F0E8D5; color: #212844; display: grid; place-items: center; flex: none; }
.perk b { display: block; font-size: 15px; }
.perk span { font-size: 13px; opacity: .75; }
@media (max-width: 899px) {
  .hero { padding: 24px 0; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 28px 22px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
}

/* ---------------------------------------------------------------- sections */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: 26px; font-weight: 700; }
.section-head p { color: var(--ink-500); margin-top: 4px; }

.grid { display: grid; gap: 16px; }
.grid-cats { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-products { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 640px) { .grid-cats, .grid-products { grid-template-columns: 1fr 1fr; gap: 12px; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 20px; }
a.card, .card.clickable { color: inherit; transition: box-shadow .15s, transform .15s, border-color .15s; }
a.card:hover, .card.clickable:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--ink-300); }

.cat-card { overflow: hidden; display: flex; flex-direction: column; }
.thumb { aspect-ratio: 4 / 3; background: var(--paper-2); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .letter { font-size: 44px; font-weight: 700; color: var(--ink-300); }
.cat-card .thumb { aspect-ratio: 16 / 9; }
.cat-card .body, .product-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cat-card h3, .product-card h3 { font-size: 16px; font-weight: 700; }
.product-card { overflow: hidden; display: flex; flex-direction: column; position: relative; }
.product-card .price { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.price b { font-size: 17px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-accent { background: var(--brand); color: var(--on-brand); }
.badge-accent::before { display: none; }
.product-card .badge-accent { position: absolute; top: 12px; inset-inline-start: 12px; }
.badge-info { background: var(--brand-tint); color: var(--brand); }
.badge-ok { background: var(--success-tint); color: var(--success); }
.badge-warn { background: var(--warning-tint); color: var(--warning); }
.badge-bad { background: var(--danger-tint); color: var(--danger); }
.badge-muted { background: var(--paper-2); color: var(--ink-500); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { padding: 24px; }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: var(--on-brand); font-weight: 700; margin-bottom: 14px; }
.step h3 { font-size: 17px; margin-bottom: 6px; }
@media (max-width: 719px) { .steps { grid-template-columns: 1fr; } }

.pay-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pay-item { display: flex; gap: 14px; align-items: center; padding: 18px; }
.pay-ico { width: 46px; height: 46px; border-radius: 14px; background: var(--paper-2); display: grid; place-items: center; flex: none; color: var(--ink-900); }
@media (max-width: 719px) { .pay-strip { grid-template-columns: 1fr; } }

.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.about .card-pad { display: flex; flex-direction: column; gap: 14px; }
.contact-list { display: flex; flex-direction: column; gap: 12px; }
.contact-row { display: flex; gap: 12px; align-items: center; }
.contact-row .pay-ico { width: 40px; height: 40px; border-radius: 12px; }
.map { border: 0; width: 100%; min-height: 240px; border-radius: var(--r-lg); background: var(--paper-2); }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 899px) { .about { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- page heading */
.page-head { padding: 32px 0 8px; }
.page-head h1 { font-size: 30px; font-weight: 700; }
.page-head p { color: var(--ink-500); margin-top: 6px; }
.crumbs { font-size: 13px; color: var(--ink-500); margin-bottom: 8px; }
.crumbs a { color: var(--ink-500); }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 16px 0 20px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-700); font: inherit; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.search { position: relative; flex: 1; min-width: 220px; max-width: 360px; margin-inline-start: auto; }
.search input { padding-inline-start: 42px; }
.search .icon { position: absolute; inset-inline-start: 14px; top: 13px; color: var(--ink-500); }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--ink-500); }
.field .req { color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; height: 46px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-900); font: inherit; padding: 0 14px; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.input.invalid { border-color: var(--danger); }
.err { color: var(--danger); font-size: 12px; min-height: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 599px) { .form-grid { grid-template-columns: 1fr; } }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { min-height: 42px; padding: 8px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.seg input:checked + label { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.seg input:focus-visible + label { box-shadow: 0 0 0 4px var(--brand-tint); }
.seg .delta { font-size: 12px; color: var(--ink-500); font-weight: 500; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); height: 46px; }
.qty button { width: 44px; height: 44px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--ink-700); }
.qty input { width: 90px; border: 0; text-align: center; font: inherit; font-weight: 700; background: none; color: var(--ink-900); height: 44px; }
.qty input:focus { outline: none; }

.drop { border: 1.5px dashed var(--ink-300); border-radius: var(--r-lg); padding: 20px; text-align: center; background: var(--paper); cursor: pointer; transition: border-color .15s, background .15s; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-tint); }
.drop input { display: none; }
.files { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: 13px; }
.file-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }

/* ---------------------------------------------------------------- product page */
.product-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 32px; align-items: start; padding-bottom: 48px; }
.product-media { position: sticky; top: 92px; }
.product-media .thumb { border-radius: var(--r-xl); border: 1px solid var(--line); }
.product-form { display: flex; flex-direction: column; gap: 20px; }
.price-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; background: var(--night); color: var(--on-night); border-radius: var(--r-lg); }
.price-box .total { font-size: 28px; font-weight: 700; }
.price-box .muted { color: #A3A9B5; }
@media (max-width: 899px) {
  .product-layout { grid-template-columns: 1fr; gap: 20px; }
  .product-media { position: static; }
  .product-media .thumb { aspect-ratio: auto; height: 240px; }
}

/* ---------------------------------------------------------------- checkout */
.checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; padding-bottom: 56px; }
.checkout .stack { display: flex; flex-direction: column; gap: 16px; }
.panel-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.panel-title .n { width: 30px; height: 30px; border-radius: 10px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-size: 14px; }
.summary { position: sticky; top: 92px; }
.line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .thumb { width: 64px; height: 64px; aspect-ratio: auto; border-radius: 12px; flex: none; }
.line .thumb .letter { font-size: 24px; }
.line .info { flex: 1; min-width: 0; }
.line .specs { font-size: 12px; color: var(--ink-500); }
.totals { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.totals .row { display: flex; justify-content: space-between; }
.totals .grand { font-size: 20px; font-weight: 700; padding-top: 10px; border-top: 1px solid var(--line); }

.pay-options { display: flex; flex-direction: column; gap: 10px; }
.pay-option { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.pay-option input { accent-color: var(--brand); width: 18px; height: 18px; }
.pay-option.selected { border-color: var(--brand); background: var(--brand-tint); }
.pay-option .pay-ico { width: 42px; height: 42px; }
.pay-option b { display: block; }
.pay-detail { margin-top: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.account { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.account .num { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.note { font-size: 13px; color: var(--ink-500); }
.alert { padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; }
.alert-bad { background: var(--danger-tint); color: var(--danger); }
.alert-info { background: var(--brand-tint); color: var(--ink-900); }
@media (max-width: 899px) {
  .checkout { grid-template-columns: 1fr; }
  .summary { position: static; }
}

.empty { text-align: center; padding: 56px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .circle { width: 72px; height: 72px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; color: var(--ink-500); }

.success { max-width: 560px; margin: 32px auto 64px; text-align: center; padding: 40px 28px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.success .circle { width: 76px; height: 76px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; }
.code-box { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.code-box div { padding: 12px 18px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); }
.code-box b { display: block; font-size: 20px; }

/* ---------------------------------------------------------------- tracking */
.track { max-width: 720px; margin: 0 auto; padding-bottom: 56px; display: flex; flex-direction: column; gap: 16px; }
.timeline { display: flex; flex-direction: column; gap: 0; margin-top: 8px; }
.tl { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; inset-inline-start: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .dot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; z-index: 1; color: var(--ink-300); }
.tl.done .dot { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.tl.done::before { background: var(--brand); }
.tl.current .dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 5px var(--brand-tint); }
.tl.bad .dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.tl b { display: block; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--night); color: rgba(240, 232, 213, .75); margin-top: 40px; padding: 44px 0 24px; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #F0E8D5; margin: 0 0 12px; font-size: 15px; }
.site-footer a { color: rgba(240, 232, 213, .75); }
.site-footer a:hover { color: #F0E8D5; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer .brand { color: #F0E8D5; }
.footer-logo { width: 150px; height: auto; opacity: .95; }
.site-footer .bottom { border-top: 1px solid rgba(240, 232, 213, .15); margin-top: 32px; padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
@media (max-width: 719px) { .site-footer .cols { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- skeleton & toast */
.skel { background: linear-gradient(90deg, var(--paper-2), var(--paper), var(--paper-2)); background-size: 200% 100%; animation: sk 1.2s infinite linear; border-radius: var(--r-lg); }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--night); color: var(--on-night); padding: 12px 20px; border-radius: var(--r-md); box-shadow: var(--shadow-pop); opacity: 0; transition: all .2s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--danger); color: #fff; }

.wa-float { position: fixed; bottom: 20px; inset-inline-start: 20px; width: 54px; height: 54px; border-radius: 50%; background: #212844; color: #F0E8D5; border: 2px solid #F0E8D5; display: grid; place-items: center; box-shadow: var(--shadow-pop); z-index: 30; }
.hp { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.err:empty { display: none; }
body { overflow-x: clip; }

/* ================================================================ v3: simpler site, accounts, students, assistant */
.wrap.narrow { max-width: 760px; }
.hero { padding: 40px 0 28px; }
.hero-copy { align-items: center; text-align: center; padding: 56px 32px; }
.hero-copy h1 { max-width: 760px; }
.hero-copy p { max-width: 620px; margin: 0 auto; }
.hero-actions { justify-content: center; }
.hero-logo-mark { width: 84px; height: auto; margin-bottom: 4px; position: relative; z-index: 1; }
.hero-copy::after { display: none; }
@media (max-width: 899px) { .hero-copy { padding: 36px 20px; } .hero-logo-mark { width: 64px; } }

.eyebrow.light { background: rgba(240, 232, 213, .14); border-color: rgba(240, 232, 213, .25); color: #F0E8D5; }

/* students: prominent banner on home + header link */
.students-banner { display: flex; align-items: center; gap: 24px; padding: 28px 32px; border-radius: var(--r-xl); background: #212844; color: #F0E8D5; position: relative; overflow: hidden; margin: 8px 0 16px; transition: transform .15s, box-shadow .15s; }
.students-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.students-banner::after { content: ""; position: absolute; inset-inline-end: -40px; top: -30px; width: 220px; height: 280px; background: url(brand/logo-mark-cream.png) center / contain no-repeat; opacity: .08; pointer-events: none; }
.students-banner h2 { font-size: 26px; margin: 8px 0 4px; color: #F0E8D5; }
.students-banner p { opacity: .8; }
.sb-icon { width: 76px; height: 76px; border-radius: 20px; background: #F0E8D5; color: #212844; display: grid; place-items: center; flex: none; }
.sb-text { flex: 1; position: relative; z-index: 1; }
.students-banner .btn { position: relative; z-index: 1; }
@media (max-width: 719px) { .students-banner { flex-direction: column; align-items: flex-start; padding: 22px; } .students-banner .btn { width: 100%; } }
.nav-students { background: #212844; color: #F0E8D5 !important; display: inline-flex; align-items: center; gap: 6px; }
.nav-students:hover, .nav-students.active { background: #2E3762 !important; box-shadow: none !important; }
.nav-staff { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--ink-300); }

.students-hero { background: #212844; color: #F0E8D5; padding: 40px 0 72px; text-align: center; }
.students-hero h1 { font-size: 34px; margin: 12px 0 8px; color: #F0E8D5; }
.students-hero p { opacity: .8; max-width: 560px; margin: 0 auto; }
#student-form { margin-top: -48px; }
.student-form { display: flex; flex-direction: column; gap: 16px; }
.step-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; margin: 6px 0 2px; }
.step-title .n { width: 30px; height: 30px; border-radius: 10px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-size: 14px; flex: none; }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.choice-cards input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.choice-cards input:checked + .choice-card { border-color: var(--brand); background: var(--brand-tint); }
.choice-cards input:focus-visible + .choice-card { box-shadow: 0 0 0 4px var(--brand-tint); }

/* inputs with a unit (cm) inside */
.input-wrap { position: relative; }
.input-wrap .unit { position: absolute; inset-inline-end: 1px; top: 1px; bottom: 1px; display: grid; place-items: center; min-width: 46px; padding: 0 10px; border-start-end-radius: var(--r-md); border-end-end-radius: var(--r-md); background: var(--paper-2); color: var(--ink-700); font-weight: 700; font-size: 14px; direction: ltr; border-inline-start: 1px solid var(--line); }
.input-wrap.has-unit .input { padding-inline-end: 60px; }
.input.readonly { display: flex; align-items: center; background: var(--paper); color: var(--ink-700); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* header account */
.acct-btn { height: 44px; padding: 0 14px; }
@media (max-width: 899px) { .acct-btn span { display: none; } .acct-btn { width: 44px; padding: 0; } }
.brand-mark.sm { width: 34px; height: 34px; border-radius: 10px; }
.wa-float { display: none; }

/* checkout */
.me-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); }
.me-row > div { flex: 1; }
.wallet { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 16px; border-radius: var(--r-lg); background: #212844; color: #F0E8D5; }
.wallet .small { opacity: .7; margin-top: 8px; }
.wallet .small:first-child { margin-top: 0; }
.wallet b { font-size: 17px; }
.wallet-num { display: flex; align-items: center; gap: 8px; }
.wallet-num b { font-size: 24px; letter-spacing: 1px; }
.wallet .btn-ghost { color: #F0E8D5; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pay-option > span:last-child { display: flex; flex-direction: column; }

/* account */
.account-card { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.account-card form { display: flex; flex-direction: column; gap: 14px; }
.account-card h2 { text-align: center; }
.circle-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; margin: 0 auto; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-radius: var(--r-md); padding: 4px; gap: 4px; }
.tabs button { height: 42px; border: 0; border-radius: 10px; background: none; font: inherit; font-weight: 700; color: var(--ink-500); cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--ink-900); box-shadow: 0 1px 3px rgba(33, 40, 68, .12); }
.account-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.account-grid form { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 899px) { .account-grid { grid-template-columns: 1fr; } }
.order-row { display: flex; justify-content: space-between; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); color: inherit; }
.order-row:last-child { border-bottom: 0; }
.order-row:hover { background: var(--paper); }

/* home contact */
.contact-card { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
@media (max-width: 719px) { .contact-card { grid-template-columns: 1fr; } }

/* AI assistant */
.ai-fab { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 20px 0 16px; border-radius: 999px; border: 2px solid #F0E8D5; background: #212844; color: #F0E8D5; font: inherit; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-pop); transition: transform .15s; }
.ai-fab:hover { transform: translateY(-2px); }
@media (max-width: 519px) { .ai-fab span { display: none; } .ai-fab { width: 56px; padding: 0; justify-content: center; } }
.ai-panel { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 41; width: min(400px, calc(100vw - 24px)); height: min(620px, calc(100vh - 40px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); overflow: hidden; }
@media (max-width: 519px) { .ai-panel { inset: 8px; width: auto; height: auto; } }
.ai-panel header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #212844; color: #F0E8D5; }
.ai-panel header > div { flex: 1; display: flex; flex-direction: column; }
.ai-panel header .small { opacity: .75; }
.ai-panel header .btn-ghost { color: #F0E8D5; }
.ai-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; line-height: 1.7; font-size: 14.5px; word-wrap: break-word; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-start-start-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-start-end-radius: 4px; }
.msg-order { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px; background: var(--success-tint); color: var(--success); font-weight: 600; }
.msg-order a { margin-inline-start: auto; font-weight: 700; }
.typing { display: flex; gap: 4px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-300); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.ai-chips { display: flex; gap: 6px; padding: 8px 12px 0; flex-wrap: wrap; background: var(--surface); }
.ai-chips button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-700); }
.ai-uploads { display: flex; gap: 8px; padding: 10px 12px 0; background: var(--surface); flex-wrap: wrap; }
.ai-uploads label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; }
.ai-form { display: flex; gap: 6px; padding: 10px 12px 12px; background: var(--surface); }
.ai-form .input { height: 44px; }
.header-actions .cart-btn { display: inline-flex !important; }

/* ================================================================ v4: account orders, debt, students */
.stack { display: flex; flex-direction: column; gap: 14px; }
.debt-banner { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 16px; border-radius: var(--r-lg); background: var(--danger-tint); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.debt-banner > div { flex: 1; display: flex; flex-direction: column; }
.debt-banner .amount { font-size: 22px; }
.orders { display: flex; flex-direction: column; gap: 12px; }
.order-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
.order-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.oc-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.oc-items li { display: flex; justify-content: space-between; gap: 8px; }
.oc-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.oc-money > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r-md); background: var(--paper); }
.oc-money .owed { background: var(--danger-tint); color: var(--danger); }
.mini-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ms { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.ms span { width: 100%; height: 6px; border-radius: 99px; background: var(--paper-2); }
.ms.done span { background: var(--brand); }
.ms.current span { background: color-mix(in srgb, var(--brand) 45%, var(--paper-2)); }
.ms small { font-size: 11px; color: var(--ink-500); line-height: 1.3; }
.ms.done small, .ms.current small { color: var(--ink-900); font-weight: 600; }
.tg-ok { display: flex; align-items: center; gap: 8px; color: var(--success); font-weight: 600; }
.student-toggle { padding: 12px 14px; border: 1.5px dashed var(--line); border-radius: var(--r-md); }
.student-toggle span { display: inline-flex; align-items: center; gap: 6px; }
.alert-info { background: var(--brand-tint); color: var(--ink-900); }
