/* ============================================================
   Mini & More — Client Onboarding Portal
   Mobile-first · RTL-ready · brand navy #1C4B80 / cyan #2AA7D6
   ============================================================ */

:root {
  /* Mini & More Product-Guide brand tokens — dark only (see style-guide) */
  --navy: #1C4B80;
  --sky: #2AA7D6;
  --bg: #0A1322;
  --surface: #101C2E;
  --surface-2: #16253B;
  --ink: #E7EEF7;
  --ink-2: #B5C4D8;
  --muted: #8497B0;
  --line: #22344D;
  --accent: #5CC3EA;
  --accent-2: #2AA7D6;
  --accent-soft: #10304A;
  --ok: #6FD3A6;
  --err: #F09A86;
  --err-bg: #2A1A1A;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.28);
  --focus: 0 0 0 3px rgba(42,167,214,.35);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Plus Jakarta Sans", system-ui, sans-serif;
  /* legacy aliases used across this stylesheet, mapped to the brand tokens */
  --navy-700: #163C66;
  --cyan: #2AA7D6;
  --cyan-600: var(--accent);
  --card: #101C2E;
  color-scheme: dark;
}

html[dir="rtl"] { --font: var(--font-ar); }

/* Light-only design — prevents browsers/devices in dark mode from
   auto-darkening the form controls and background. */
:root { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
button { font-family: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand__logo { height: 26px; display: block; }
.lang-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--accent);
  font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 999px;
  cursor: pointer; transition: .15s;
}
.lang-toggle:hover { border-color: var(--cyan); color: var(--cyan-600); }

/* ---------- Shell ---------- */
.shell { max-width: 620px; margin: 0 auto; padding: 20px 16px 96px; }
.screen { display: none; animation: fade .25s ease; }
.screen.is-active { display: block; }
[hidden] { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Landing ---------- */
.landing { text-align: center; padding: 28px 8px 8px; }
.landing__badge {
  display: inline-block; background: rgba(42,167,214,.12); color: var(--cyan-600);
  font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.landing__title { font-size: 30px; line-height: 1.15; margin: 0 0 12px; color: var(--accent); }
.landing__lead { color: var(--muted); font-size: 16px; margin: 0 auto 22px; max-width: 440px; }
.landing__facts { list-style: none; padding: 0; margin: 0 auto 26px; max-width: 340px; text-align: start; display: grid; gap: 10px; }
.landing__facts li { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow); }
.landing__ico { display: inline-flex; align-items: center; color: var(--accent); flex: none; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 15px; padding: 12px 20px; cursor: pointer;
  transition: transform .05s, background .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--sky); color: #fff; }
.btn--primary:hover:not(:disabled) { background: #1f95c2; }
.btn--soft { background: rgba(42,167,214,.1); color: var(--cyan-600); }
.btn--soft:hover { background: rgba(42,167,214,.18); }
.btn--ghost { background: var(--surface); color: var(--accent); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--link { background: none; color: var(--muted); text-decoration: underline; padding: 12px 8px; }
.btn--link:hover { color: var(--accent); }
.btn--lg { font-size: 17px; padding: 15px 28px; width: 100%; max-width: 320px; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- Steps / progress ---------- */
.steps-wrap { display: block; margin-bottom: 22px; }
.steps { display: flex; gap: 6px; }
.steps__dot { flex: 1; height: 6px; border-radius: 999px; background: var(--line); position: relative; }
.steps__dot.is-done { background: var(--cyan); }
.steps__dot.is-active { background: var(--navy); }
.steps__meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.steps__meta b { color: var(--accent); }

/* ---------- Wizard / fields ---------- */
.wizard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 18px 18px; }
.step { display: none; border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.step.is-active { display: block; animation: fade .2s ease; }
.step__title { font-size: 20px; font-weight: 700; color: var(--accent); padding: 0; margin: 0 0 4px; }
.step__hint { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s; outline: none;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan); box-shadow: var(--focus); }
.field__note { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.field__err { display: none; color: var(--err); font-size: 12.5px; margin-top: 6px; font-weight: 500; }
#locationErr { margin-bottom: 10px; }
.field--gap { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--err); background: var(--err-bg); }
.field.is-invalid .field__err { display: block; }

/* Intl phone: [dial-code select] + [masked number]. The whole field is LTR
   so the dial code is always on the LEFT (both LTR and RTL) and the number
   reads left-to-right. The label above still follows the layout direction. */
.phone { display: flex; gap: 8px; align-items: stretch; direction: ltr; }
.phone .phone__dial { flex: 0 0 118px; width: 118px; padding-inline: 10px; font-size: 15px; }
.phone .phone__num { flex: 1 1 auto; width: auto; min-width: 0; text-align: left; }

/* Latin-content fields (phone, email, links) always read LTR, even in RTL. */
.field input[type="email"],
.field input[type="url"],
.field input[type="tel"],
.phone .phone__num { direction: ltr; }
html[dir="rtl"] .field input[type="email"],
html[dir="rtl"] .field input[type="url"] { text-align: right; }

/* Force LTR for any phone value shown inside RTL text (e.g. the review). */
.ltr { direction: ltr; unicode-bidi: isolate; }

/* Two fields side by side (country+city, social pairs) */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 460px) { .field-row { grid-template-columns: 1fr; } }

/* Language chip multi-select.
   Avoid a pure-#fff background: aggressive forced-dark modes lighten the
   text but leave #fff untouched → white-on-white. A tinted background +
   explicit navy text + a solid border keep it readable everywhere. */
.lang-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-chip {
  border: 1.5px solid #cdd8e6;
  background: #eef2f8;
  color: #1C4B80;
  border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 700; cursor: pointer; transition: .12s;
}
.lang-chip:hover { border-color: var(--cyan); background: #e4ebf4; }
.lang-chip.is-selected { background: var(--navy); color: #fff; border-color: var(--navy); }
.lang-chip.is-selected::before { content: '✓ '; }

/* Social links block inside the "more info" step */
.social-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.social-block__title { font-weight: 600; font-size: 14px; color: var(--accent); margin-bottom: 10px; }

.or-divider { display: flex; align-items: center; gap: 14px; margin: 18px 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line) 30%, var(--line) 70%, transparent); }
.or-divider span { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: .02em; padding: 5px 16px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface-2); line-height: 1.4; }

/* A field that was filled in automatically gets a brief highlight */
.field.is-autofilled select, .field.is-autofilled input { animation: autofill 1.4s ease-out; }
@keyframes autofill { 0% { box-shadow: 0 0 0 3px rgba(42,167,214,.55); } 100% { box-shadow: 0 0 0 3px rgba(42,167,214,0); } }
@media (prefers-reduced-motion: reduce) { .field.is-autofilled select, .field.is-autofilled input { animation: none; } }

/* ---------- Uploader ---------- */
.uploader { margin-bottom: 8px; }
.uploader__drop {
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface-2);
  padding: 22px; text-align: center; cursor: pointer; transition: .15s;
}
.uploader__drop:hover, .uploader__drop.is-drag { border-color: var(--cyan); background: rgba(42,167,214,.06); }
.uploader__drop:focus-visible { outline: none; box-shadow: var(--focus); }
.uploader__cta { display: grid; gap: 4px; justify-items: center; color: var(--muted); }
.uploader__cta strong { color: var(--ink); font-size: 15px; }
.uploader__ico { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.uploader__types { font-size: 12.5px; }
.uploader__preview { margin-bottom: 12px; }
.uploader__preview img { max-height: 120px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); padding: 6px; }
.uploader__preview .filechip { display: inline-flex; align-items: center; gap: 8px; }
.uploader__bar { height: 6px; border-radius: 999px; background: var(--line); margin-top: 10px; overflow: hidden; }
.uploader__bar-fill { height: 100%; width: 0; background: var(--cyan); transition: width .2s; }
.filechip { background: rgba(42,167,214,.1); color: var(--cyan-600); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }

/* ---------- Segmented (menu tabs) ---------- */
.segmented { display: flex; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.segmented__btn { flex: 1; border: 0; background: none; border-radius: 999px; padding: 9px 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: .15s; }
.segmented__btn.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.segmented--wrap { flex-wrap: wrap; }
.segmented--wrap .segmented__btn { flex: 1 1 44%; }
.menu-pane { animation: fade .2s ease; }

/* Menu source — stacked, one clear option per row (radio style) */
#menuTabs { flex-direction: column; gap: 8px; background: none; border: 0; border-radius: 0; padding: 0; margin-bottom: 16px; }
#menuTabs .segmented__btn { flex: 1 1 auto; width: 100%; text-align: start; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 13px 15px; font-size: 14.5px; display: flex; align-items: center; gap: 11px; box-shadow: none; }
#menuTabs .segmented__btn::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; transition: .15s; }
#menuTabs .segmented__btn:hover { border-color: var(--cyan-600); }
#menuTabs .segmented__btn.is-active { color: var(--accent); background: rgba(42,167,214,.06); border-color: var(--cyan-600); box-shadow: none; }
#menuTabs .segmented__btn.is-active::before { border-color: var(--cyan-600); background: radial-gradient(circle, var(--cyan-600) 0 5px, transparent 6px); }

/* Read-only application view (shared ?application= link, after submit) */
.wizard.is-readonly .wizard__nav,
.wizard.is-readonly .review__edit,
.wizard.is-readonly .step__hint { display: none !important; }
.ro-banner { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 11px 14px; border: 1px solid var(--line); border-inline-start: 3px solid var(--cyan-600); border-radius: 10px; background: var(--surface-2); color: var(--accent); font-size: 13px; }

/* ---------- Manual menu ---------- */
.manual__cat { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.manual__cat-head { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.manual__cat-head input { flex: 1; font-weight: 600; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 15px; }
.manual__items { padding: 10px 12px; display: grid; gap: 8px; }
.manual__item { display: grid; grid-template-columns: 1fr 84px auto; gap: 6px; }
.manual__item input { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 14px; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 8px; width: 38px; cursor: pointer; font-size: 15px; }
.icon-btn:hover { color: var(--err); border-color: var(--err); }
.manual__additem { margin: 4px 12px 12px; }

/* ---------- Callout ---------- */
.callout { background: rgba(28,75,128,.05); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.callout strong { display: block; margin-bottom: 6px; font-size: 14px; }
.callout__code { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--muted); white-space: pre; }

/* ---------- Review ---------- */
.review { display: grid; gap: 12px; margin-bottom: 20px; }
.review__group { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.review__group h4 { margin: 0; padding: 10px 14px; background: var(--surface-2); font-size: 14px; color: var(--accent); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.review__edit { font-size: 12.5px; color: var(--cyan-600); background: none; border: 0; cursor: pointer; font-weight: 600; }
.review__rows { padding: 6px 14px 12px; }
.review__row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.review__row:last-child { border-bottom: 0; }
.review__row dt { color: var(--muted); }
.review__row dd { margin: 0; text-align: end; font-weight: 500; max-width: 60%; word-break: break-word; }
.review__row dd.is-empty { color: var(--muted); font-weight: 400; font-style: italic; }
.review__row dd a { color: var(--cyan-600); text-decoration: underline; word-break: break-all; }
.review__row dd .is-empty { font-style: italic; }
.pill-ok { color: var(--ok); font-weight: 600; }

.confirm { display: flex; gap: 10px; align-items: flex-start; background: rgba(42,167,214,.06); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; cursor: pointer; }
.confirm input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }

/* ---------- Wizard nav ---------- */
/* Navigation: [Back] [—— Next ——] then Skip and Save as quiet text actions */
.wizard__nav { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "back next" "skip skip" "save save";
  align-items: center; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.wizard__nav #backBtn { grid-area: back; }
.wizard__nav #nextBtn, .wizard__nav #submitBtn { grid-area: next; width: 100%; justify-content: center; margin: 0; }
.wizard__nav #skipBtn { grid-area: skip; justify-self: center; margin: 0; border-color: transparent; background: transparent; color: var(--muted); }
.wizard__nav #skipBtn:hover { color: var(--ink); text-decoration: underline; }
.wizard__nav .btn--link { grid-area: save; justify-self: center; text-align: center; }
.wizard__nav [hidden] { display: none !important; }

/* ---------- Done ---------- */
.done { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 22px; }
.done__check { width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 50%; background: rgba(31,157,85,.12); color: var(--ok); font-size: 34px; display: grid; place-items: center; }
.done__title { color: var(--accent); font-size: 26px; margin: 0 0 10px; }
.done__lead { color: var(--muted); max-width: 420px; margin: 0 auto 22px; }
.done__id { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 12px 18px; margin-bottom: 14px; }
.done__id span { color: var(--muted); font-size: 13px; }
.done__id strong { font-size: 20px; color: var(--accent); letter-spacing: .02em; font-family: ui-monospace, Menlo, monospace; }
.copy-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--accent); cursor: pointer; }
.done__status { font-size: 15px; }
.done__note { color: var(--muted); font-size: 13px; }
.done__share { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.done__share-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.done__share-row { display: flex; gap: 6px; align-items: stretch; flex-wrap: wrap; justify-content: center; }
.done__share-row input { flex: 1 1 200px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; background: var(--bg); direction: ltr; text-align: left; }
.btn--sm { padding: 8px 12px; font-size: 13px; }
.done__share-row a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,28,46,.5); display: grid; place-items: center; padding: 20px; z-index: 40; }
.modal__box { background: var(--surface); border-radius: var(--radius); padding: 24px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal__box h3 { margin: 0 0 8px; color: var(--accent); }
.modal__box p { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.save-link { display: flex; gap: 8px; margin-bottom: 16px; }
.save-link input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 13px; background: var(--bg); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: fade .2s ease; max-width: 90vw; text-align: center; }
.toast--err { background: var(--err); }

/* ---------- Site footer ---------- */
.site-footer { text-align: center; padding: 28px 16px 40px; }
.site-footer__logo { height: 26px; width: auto; opacity: .85; transition: opacity .15s; }
.site-footer a:hover .site-footer__logo { opacity: 1; }
.site-footer__note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

/* ---------- Overlay ---------- */
.overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 60; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- RTL tweaks ---------- */
html[dir="rtl"] .review__row dd { text-align: start; }


/* ---------- Desktop ---------- */
@media (min-width: 560px) {
  .shell { padding-top: 32px; }
  .wizard { padding: 28px 26px 22px; }
  .landing__title { font-size: 34px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* "Optional" tag next to a field label */
.field label .opt, .social-block__title .opt { display: inline-block; margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500; line-height: 18px; vertical-align: middle;
  color: var(--muted); background: var(--surface-2, rgba(255,255,255,.05)); border: 1px solid var(--line); }
.extra-block { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.social-block__title .opt { font-weight: 500; }
