/* Merchant pages: log in, sign up, password reset and the dashboard.
   Tokens, fonts and controls come from theme.css; passes and phones from cards.css. */

/* ---------- top bar ---------- */
.m-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px;
  max-width: 1200px; margin: 0 auto; padding: 18px 24px;
}
.m-brand { display: inline-flex; align-items: center; min-height: 44px; }
.m-brand img { display: block; height: 32px; width: auto; }
.m-top-links { display: flex; align-items: center; gap: 4px 18px; }
.m-top-links a, .m-link-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px;
  color: var(--text-2); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none;
  background: none; border: 0; cursor: pointer;
}
.m-top-links a:hover, .m-link-btn:hover { color: var(--text); }
.m-top-links .btn { color: var(--text); padding-inline: 16px; }
html:not([lang="ar"]) .m-top-links a[lang="ar"] { font-size: 16px; }

/* ---------- single-panel pages (log in, forgot, reset) ---------- */
.auth { display: grid; justify-items: center; padding: 28px 16px 80px; }
.panel {
  width: 100%; max-width: 440px; padding: 36px 32px;
  background: linear-gradient(180deg, rgba(27, 47, 94, .55), rgba(13, 26, 56, .92));
  border: 1px solid var(--border); border-radius: 22px;
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.panel-mark { width: 44px; height: 44px; margin-bottom: 22px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-3); color: var(--action); }
.panel-mark svg { width: 24px; height: 24px; }
.panel h1 { font-size: clamp(26px, 3.4vw, 32px); font-weight: 700; letter-spacing: -.02em; }
.panel-sub { margin: 10px 0 28px; color: var(--text-2); font-size: 16px; }
html[lang="ar"] .panel h1 { letter-spacing: 0; }

/* ---------- fields ---------- */
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > input, .field > .pw > input { width: 100%; min-height: 48px; font-size: 16px; }
.field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-top a { font-size: 14px; font-weight: 600; text-decoration: none; }
.field-top a:hover { text-decoration: underline; }
.hint { margin: 0; font-size: 13.5px; color: var(--text-3); }
.field-err { margin: 0; font-size: 14px; color: var(--error); }
.field-err:empty { display: none; }
input[aria-invalid="true"] { border-color: var(--error); }
input[readonly] { color: var(--text-2); background: transparent; border-style: dashed; cursor: default; }

.pw { position: relative; }
.pw input { padding-inline-end: 76px; }
.pw-toggle {
  position: absolute; inset-block: 2px; inset-inline-end: 2px; min-width: 68px; padding: 0 12px;
  border: 0; border-radius: 8px; background: none; color: var(--link);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.pw-toggle:hover { color: var(--text); }

.form-msg { margin: 14px 0 0; font-size: 15px; line-height: 1.5; }
.form-msg:empty { display: none; }
.form-msg[data-kind="error"] { color: var(--error); }
.form-msg[data-kind="ok"] { color: var(--success); }
.form-msg a { color: inherit; font-weight: 700; }

.notice {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 22px; padding: 12px 14px;
  border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface-2);
  color: var(--text); font-size: 15px;
}
.notice[hidden] { display: none; }
.notice svg { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--action); }
.notice.ok svg { color: var(--success); }
/* "Accounts open soon": a short, fully rounded status pill */
.notice[data-closed] {
  width: fit-content; max-width: 100%; align-items: center; gap: 8px;
  padding-block: 7px; padding-inline: 10px 16px; border-radius: 999px;
  border-color: rgba(255, 185, 56, .5); background: rgba(255, 185, 56, .1);
  font-size: 14px; font-weight: 600;
}
.notice[data-closed] svg { width: 18px; height: 18px; margin-top: 0; }

.auth-alt { margin: 24px 0 0; text-align: center; color: var(--text-2); font-size: 15px; }
.auth-alt a { font-weight: 700; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

.hp { position: absolute; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0; }

.btn[aria-busy="true"] { cursor: progress; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; }
@media (prefers-reduced-motion: no-preference) { .btn .spin { animation: m-spin .7s linear infinite; } }
@keyframes m-spin { to { transform: rotate(1turn); } }

/* ---------- sign up ---------- */
.signup {
  display: grid; grid-template-columns: minmax(0, 540px) minmax(0, 1fr); gap: 40px 64px; align-items: start;
  max-width: 1200px; margin: 0 auto; padding: 8px 24px 88px;
}
.signup .panel { max-width: none; }
.steps { margin-bottom: 26px; }
.steps-count { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
html[lang="ar"] .steps-count { letter-spacing: 0; font-size: 14px; text-transform: none; }
.steps-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.steps-bar span { height: 4px; border-radius: 2px; background: var(--border); transition: background-color .25s; }
.steps-bar span.on { background: var(--action); }
.step { margin: 0; padding: 0; border: 0; min-width: 0; }
.step[hidden] { display: none; }
.step legend { padding: 0; font-size: clamp(24px, 3vw, 29px); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
html[lang="ar"] .step legend { letter-spacing: 0; line-height: 1.45; }
.step-sub { margin: 8px 0 24px; color: var(--text-2); }
.step-title { outline: none; }

.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 0; padding: 0; border: 0; }
.types legend { margin-bottom: 10px; font-size: 14px; font-weight: 600; color: var(--text); }
.type { position: relative; }
.type input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.type span {
  display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 88px; padding: 12px 6px;
  border: 1px solid var(--border-strong); border-radius: 14px; background: var(--field);
  text-align: center; font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--text-2);
  transition: border-color .15s, background-color .15s, color .15s;
}
.type svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.type input:hover + span { border-color: var(--text-2); color: var(--text); }
.type input:checked + span { border-color: var(--action); background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--action); }
.type input:checked + span svg { color: var(--action); }
.type input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }

.step-actions { display: flex; gap: 12px; margin-top: 28px; }
.step-actions .btn-primary { flex: 1; }
.step-actions .btn-ghost[hidden] { display: none; }

.signup .picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; margin-top: 0; }
.signup .pick-title { font-size: 13px; }
/* "Suggested" sits on the thumbnail itself: solid, so it reads on any artwork */
.rec {
  position: absolute; z-index: 2; inset-block-end: 6px; inset-inline-end: 6px;
  padding: 2px 8px; border-radius: 999px; background: var(--action); color: var(--action-ink);
  font-family: var(--font); font-size: 11.5px; font-weight: 700; line-height: 1.5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
.signup-stage { position: sticky; top: 16px; }
.stage-intro { margin: 4px 0 24px; text-align: center; }
.stage-intro h2 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; letter-spacing: -.02em; }
html[lang="ar"] .stage-intro h2 { letter-spacing: 0; }
.stage-intro p { margin: 8px auto 0; max-width: 48ch; color: var(--text-2); font-size: 15.5px; }
.perks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.perks li { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: rgba(13, 26, 56, .6); font-size: 13.5px; color: var(--text-2); }

/* ---------- dashboard ---------- */
.dash { max-width: 1200px; margin: 0 auto; padding: 8px 24px 88px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 24px; margin-bottom: 32px; }
.dash-head h1 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; letter-spacing: -.025em; }
html[lang="ar"] .dash-head h1 { letter-spacing: 0; }
.dash-head p { margin: 8px 0 0; color: var(--text-2); max-width: 60ch; }
.card-box {
  padding: 28px; border: 1px solid var(--border); border-radius: 22px;
  background: linear-gradient(180deg, rgba(19, 36, 73, .6), rgba(13, 26, 56, .85));
}
.card-box h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
html[lang="ar"] .card-box h2 { letter-spacing: 0; }
.box-sub { margin: 6px 0 22px; color: var(--text-2); font-size: 15px; }
.dash .studio { gap: 40px 48px; }
.dash .picker { margin-top: 22px; }
/* The save bar follows the viewport while the long design list scrolls by */
.save-row {
  position: sticky; bottom: 12px; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 24px -12px 0; padding: 12px;
  border: 1px solid var(--border); border-radius: 16px;
  background: rgba(10, 21, 48, .94); box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .9);
}
.save-state { font-size: 14px; color: var(--text-3); }
.save-state[data-kind="dirty"] { color: var(--action); }
.save-state[data-kind="ok"] { color: var(--success); }
.save-state[data-kind="error"] { color: var(--error); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; }
.checklist { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.checklist li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.checklist li:first-child { border-top: 0; padding-top: 4px; }
.tick { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border-strong); color: var(--text-2); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tick svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.checklist li.done .tick { border-color: transparent; background: rgba(82, 224, 160, .16); color: var(--success); }
.checklist strong { display: block; font-size: 16px; color: var(--text); }
.checklist p { margin: 3px 0 0; font-size: 14.5px; color: var(--text-2); }
.checklist a { font-weight: 700; text-decoration: none; }
.checklist a:hover { text-decoration: underline; }
.split { margin: 26px 0 0; padding-top: 22px; border-top: 1px solid var(--border); }
.split h3 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }

.dash-loading { padding: 80px 0; text-align: center; color: var(--text-2); }
.welcome {
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: 24px; padding: 14px 16px;
  border: 1px solid rgba(82, 224, 160, .45); border-radius: 14px; background: rgba(82, 224, 160, .08);
}
.welcome[hidden] { display: none; }
.welcome svg { flex: none; width: 22px; height: 22px; color: var(--success); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- sizes ---------- */
@media (max-width: 1099px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Beside the form there's room for one full-size phone until 1280px: show one, with the iPhone/Samsung switch */
@media (min-width: 960px) and (max-width: 1279px) {
  .signup .device-tabs { display: flex; }
  .signup .devices[data-show="iphone"] .samsung, .signup .devices[data-show="samsung"] .iphone { display: none; }
}
@media (max-width: 959px) {
  .signup { grid-template-columns: minmax(0, 1fr); gap: 48px; padding-bottom: 64px; }
  .signup .panel { max-width: 560px; margin: 0 auto; width: 100%; }
  .signup-stage { position: static; }
}
@media (max-width: 719px) {
  .signup .picker { display: flex; }
}
@media (max-width: 560px) {
  .m-top { padding: 12px 16px; }
  .m-brand img { height: 28px; }
  .panel { padding: 28px 20px; border-radius: 18px; }
  .auth { padding-top: 12px; }
  .signup, .dash { padding-inline: 16px; }
  .card-box { padding: 22px 18px; }
  .types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .types .type:last-of-type { grid-column: 1 / -1; } /* nine tiles: the last one spans the row */
  .types .type:last-of-type span { min-height: 64px; }
}
@media (max-width: 359px) {
  .m-top-links { gap: 4px 12px; }
  .m-top-links .btn { padding-inline: 12px; }
}
