/* ============================================================
   WIRD — APPLICATION STYLES (auth + future role areas)
   Extends the landing page design system in assets/css/style.css.
   Palette: deep wine primary (#54152a), gold accent (#c8972a),
   cream surfaces (#faf8f6). Typography: Inter + Amiri (Arabic).
   ============================================================ */

:root {
  /* Wine alias tokens — --green in style.css is the deep wine */
  --wine:        #54152a;
  --wine-deep:   #3b1020;
  --wine-tint:   #f7eef1;
  --wine-glow:   rgba(84, 21, 42, .12);
  --gold:        #c8972a;
  --gold-tint:   #fdf4e3;
  --cream:       #faf8f6;
  --ink:         #1c1016;
  --ink-mid:     #3d2530;
  --ink-muted:   #7a6068;
  --line:        #ede3e6;
  --line-soft:   #f5f0f2;
  --danger:      #b3405a;
  --danger-glow: rgba(179, 64, 90, .12);
  --success:     #2f6b52;
  --success-tint:#eef6f1;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-md:   0 4px 16px rgba(84, 21, 42, .10), 0 2px 6px rgba(84, 21, 42, .05);
  --shadow-lg:   0 16px 48px rgba(84, 21, 42, .12), 0 4px 12px rgba(84, 21, 42, .07);
  --shadow-wine: 0 8px 24px rgba(84, 21, 42, .30);
}

/* ============================================================
   AUTH PAGE SHELL
   ============================================================ */

.auth-body {
  min-height: 100dvh;
  margin: 0;
  /* style.css gives the landing page body a 100px top offset for the
     floating navbar — the auth pages must not inherit that */
  padding-top: 0;
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  overflow-y: auto;
}

/* Let the page scroll only when the viewport genuinely cannot fit it */
@media (max-height: 860px) {
  .auth-body { overflow-y: auto; }
}
@media (max-width: 560px) {
  .auth-body { overflow-y: auto; }
}

/* Geometric arabesque field + wine/gold ambient light */
.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat, no-repeat, repeat;
  background-image:
    radial-gradient(880px 520px at 50% -12%, rgba(84, 21, 42, .13), transparent 72%),
    radial-gradient(720px 440px at 50% 112%, rgba(200, 151, 42, .13), transparent 72%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='124' height='124' viewBox='0 0 124 124'%3E%3Cg fill='none' stroke='%2354152a' stroke-opacity='.05' stroke-width='1'%3E%3Cpath d='M62 4 C73 41 83 51 120 62 C83 73 73 83 62 120 C51 83 41 73 4 62 C41 51 51 41 62 4 Z'/%3E%3C/g%3E%3C/svg%3E");
}

.auth-main {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vh, 30px) 20px;
}

.auth-wrap {
  width: 100%;
  max-width: 520px;
  text-align: center;
}

/* Brand lockup above the card */
.auth-brand {
  justify-content: center;
  gap: 12px;
  font-size: 25px;
  margin-bottom: clamp(16px, 2.6vh, 26px);
  transition: opacity .2s ease;
}
.auth-brand:hover { opacity: .82; }
.auth-brand .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--wine);
  color: #fff;
  box-shadow: var(--shadow-wine);
}
.auth-brand .brand-mark svg { width: 25px; height: 25px; }

/* ============================================================
   AUTH CARD
   ============================================================ */

.auth-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(26px, 4.2vh, 44px) clamp(28px, 3.4vw, 46px) clamp(22px, 3.6vh, 40px);
  text-align: left;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Gold-to-wine hairline along the top edge */
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--wine) 55%, var(--wine-deep) 100%);
}

.auth-card-head { margin-bottom: clamp(20px, 3vh, 30px); }

.auth-arabic {
  font-family: 'Amiri', 'Scheherazade New', Tahoma, serif;
  font-size: 30px;
  line-height: 1.5;
  color: var(--gold);
  margin: 0 0 4px;
  letter-spacing: 0;
}

.auth-title {
  font-size: clamp(26px, 4vh, 34px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 9px;
}

.auth-sub {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-muted);
  margin: 0;
}

/* ============================================================
   FIELDS
   ============================================================ */

.auth-form .field { margin-bottom: clamp(14px, 2.2vh, 20px); }

.auth-form .form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-mid);
  margin: 0 0 9px;
  letter-spacing: -.005em;
}
.auth-form .req-mark {
  color: var(--danger);
  margin-left: 3px;
  font-weight: 700;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 18px;
  font-size: 17px;
  color: var(--ink-muted);
  pointer-events: none;
  transition: color .2s ease;
  z-index: 2;
}

.input-shell:focus-within .input-icon { color: var(--wine); }

.auth-form .form-control {
  height: clamp(50px, 6.4vh, 58px);
  padding-left: 48px;
  padding-right: 50px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.auth-form .form-control::placeholder { color: #b9a7ad; }

.auth-form .form-control:focus {
  background: #fff;
  border-color: var(--wine);
  box-shadow: 0 0 0 4px var(--wine-glow);
  outline: none;
}

.password-toggle {
  position: absolute;
  right: 9px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 17px;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.password-toggle:hover { color: var(--wine); background: var(--wine-tint); }
.password-toggle:focus-visible { outline: 2px solid var(--wine); outline-offset: 1px; }

/* Validation */
.field-error {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--danger);
  margin: 8px 0 0;
}

.field.has-error .field-error { display: flex; }
.field-error.is-visible { display: flex; }
.field.has-error .form-control,
.auth-form .form-control.input-validation-error { border-color: var(--danger); }
.field.has-error .form-control:focus,
.auth-form .form-control.input-validation-error:focus { box-shadow: 0 0 0 4px var(--danger-glow); }
.field.has-success .form-control { border-color: var(--success); }

.field-validation-valid { display: none; }
.field-validation-error {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: var(--danger);
  margin: 8px 0 0;
}

.field-hint {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 10px 0 0;
}

/* ============================================================
   LINKS, SUBMIT, ALTERNATE ACTIONS
   ============================================================ */

.auth-row {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 24px;
}

.auth-link {
  color: var(--wine);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color .18s ease;
}
.auth-link:hover { color: var(--wine-deep); text-decoration: underline; }
.auth-link:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; border-radius: 4px; }

.auth-submit {
  width: 100%;
  height: clamp(52px, 6.6vh, 60px);
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  padding: 0 26px;
  background: var(--wine);
  color: #fff !important;
  box-shadow: var(--shadow-wine);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.auth-submit:hover {
  background: var(--wine-deep);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(84, 21, 42, .28);
}
.auth-submit:active { transform: scale(.99); }
.auth-submit:disabled { opacity: .72; transform: none; cursor: default; }
.auth-submit.is-loading,
.auth-submit.is-loading:hover {
  background: var(--wine);
  box-shadow: var(--shadow-wine);
  transform: none;
}
.auth-submit.is-loading:disabled {
  opacity: 1;
}

/* Compact variant — used on the "User type" step.
   display:flex makes it a block box so auto margins actually centre it. */
.auth-submit-compact {
  display: flex;
  width: auto;
  min-width: 240px;
  margin: clamp(18px, 3vh, 32px) auto 0;
}

.auth-submit .spinner-border {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, .35);
  border-top-color: #fff;
}

.auth-submit .btn-label { line-height: 1; }

.auth-alt {
  margin: clamp(16px, 2.4vh, 24px) 0 0;
  font-size: 14.5px;
  color: var(--ink-muted);
  text-align: center;
}

/* ============================================================
   STATUS MESSAGE
   ============================================================ */

.auth-status {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 15px 17px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
}
.auth-status.is-visible { display: flex; }
.auth-status.is-success {
  background: var(--success-tint);
  border: 1px solid rgba(47, 107, 82, .18);
  color: #24543f;
}
.auth-status.is-error {
  background: #fdf2f4;
  border: 1px solid rgba(179, 64, 90, .2);
  color: #8e2f45;
}
.auth-status .bi { font-size: 15px; line-height: 1.4; flex-shrink: 0; }
.auth-status strong { font-weight: 700; }

/* ============================================================
   DEMO ACCOUNTS (template helper)
   ============================================================ */

.auth-demo { margin-top: clamp(18px, 3vh, 30px); }

.auth-demo-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #a08d94;
  margin-bottom: 12px;
}

.auth-demo-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 17px 9px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-mid);
  cursor: pointer;
  transition: all .18s ease;
}
.demo-chip:hover { border-color: var(--wine); color: var(--wine); background: var(--wine-tint); }
.demo-chip:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.demo-chip.is-active { border-color: var(--wine); background: var(--wine); color: #fff; }

.demo-chip-avatar {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: var(--wine-tint);
  color: var(--wine);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .02em;
}
.demo-chip.is-active .demo-chip-avatar { background: rgba(255, 255, 255, .2); color: #fff; }

.auth-help {
  margin: clamp(14px, 2.2vh, 22px) 0 0;
  font-size: 13.5px;
  color: var(--ink-muted);
  text-align: center;
}

/* ============================================================
   AUTH — ROLE PICKER, CHECKBOX, STRENGTH METER, SUCCESS
   ============================================================ */

/* ============================================================
   AUTH — WIZARD: TOP BAR, STEPPER, PHONE FIELD, PANELS
   ============================================================ */

.auth-signup .auth-main {
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0 20px clamp(24px, 4vh, 40px);
  gap: clamp(12px, 2.4vh, 24px);
}

.auth-signup .auth-wrap {
  max-width: 540px;
  margin: auto 0;
  transition: max-width .24s ease;
}

.auth-signup .auth-wrap.is-role-step {
  max-width: 680px;
}

/* Top bar: back | brand | language — in-flow header so it never overlaps content */
.auth-topbar {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1200px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 0 auto;
  padding: clamp(16px, 2.6vh, 26px) clamp(4px, 1.5vw, 24px) 0;
}
.auth-topbar > :first-child { justify-self: start; }
.auth-topbar > :last-child { justify-self: end; }

.auth-topbar-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(8px);
  color: var(--ink-mid);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(84, 21, 42, .05);
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.auth-topbar-back .bi { font-size: 16px; line-height: 1; }
.auth-topbar-back:hover:not(:disabled) {
  background: #fff;
  border-color: #dbc5cd;
  color: var(--wine);
  box-shadow: 0 4px 12px rgba(84, 21, 42, .08);
}
.auth-topbar-back:disabled { opacity: .55; cursor: default; }
.auth-topbar-back:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }

.auth-brand-inline {
  justify-content: center;
  margin: 0;
  font-size: 22px;
  gap: 11px;
  text-decoration: none;
}
.auth-brand-inline .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  box-shadow: 0 6px 16px rgba(84, 21, 42, .22);
}
.auth-brand-inline .brand-mark svg { width: 21px; height: 21px; }

.auth-lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(8px);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-mid);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(84, 21, 42, .05);
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.auth-lang .bi-globe2 { color: var(--wine); font-size: 15px; }
.auth-lang:hover {
  background: #fff;
  border-color: #dbc5cd;
  color: var(--wine);
  box-shadow: 0 4px 12px rgba(84, 21, 42, .08);
}
.auth-lang:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.auth-lang-flag { font-size: 16px; line-height: 1; }
.auth-lang .bi-chevron-down { font-size: 11px; color: var(--ink-muted); }

.auth-topbar .dropdown-menu,
.auth-wrap .dropdown-menu {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  font-size: 14px;
}
.auth-topbar .dropdown-item,
.auth-wrap .dropdown-item {
  border-radius: 9px;
  padding: 9px 13px;
  color: var(--ink-mid);
}
.auth-topbar .dropdown-item:hover,
.auth-topbar .dropdown-item:focus,
.auth-wrap .dropdown-item:hover,
.auth-wrap .dropdown-item:focus {
  background: var(--wine-tint);
  color: var(--wine);
}

/* Wizard header */
.auth-wizard-head {
  text-align: center;
  margin-bottom: clamp(18px, 2.8vh, 26px);
}
.auth-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--gold-tint);
  border: 1px solid rgba(200, 151, 42, .25);
  color: #8a6414;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.auth-step-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--gold);
}
.auth-title-center {
  text-align: center;
  margin: 0 0 8px;
}
.auth-sub-center {
  text-align: center;
  max-width: 48ch;
  margin: 0 auto;
  font-size: 14.5px;
  line-height: 1.6;
  color: #664c55;
}

/* Stepper */
.stepper[hidden] { display: none; }
.stepper {
  display: flex;
  align-items: flex-start;
  list-style: none;
  padding: 0;
  margin: 0 auto clamp(18px, 3vh, 30px);
  max-width: 460px;
}
.stepper-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.stepper-line {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #ece3e7;
  z-index: 1;
  transition: background .25s ease;
}
.stepper-item:last-child .stepper-line { display: none; }
.stepper-item.is-done .stepper-line { background: var(--wine); }
.stepper-dot {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f1ebee;
  color: #a08d94;
  font-size: 14px;
  font-weight: 700;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}
.stepper-item.is-active .stepper-dot {
  background: var(--wine);
  color: #fff;
  box-shadow: 0 4px 14px rgba(84, 21, 42, .28);
}
.stepper-item.is-done .stepper-dot { background: var(--wine); color: #fff; }
.stepper-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color .25s ease;
}
.stepper-item.is-active .stepper-label { color: var(--ink); font-weight: 700; }
.stepper-item.is-done .stepper-label { color: var(--ink-mid); font-weight: 600; }

/* Wizard panels inside one card */
.auth-panel[hidden] { display: none; }
.auth-panel {
  animation: authPanelIn .24s ease;
}
@keyframes authPanelIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-panel > .field:last-of-type { margin-bottom: 22px; }

/* Phone number row */
.phone-row { display: flex; gap: 10px; }
.phone-row .input-shell { flex: 1; min-width: 0; }
.phone-country {
  flex: 0 0 auto;
  height: clamp(50px, 6.4vh, 58px);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.phone-country:hover { border-color: #dbc5cd; }
.phone-country:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 4px var(--wine-glow); }
.phone-country-flag { font-size: 16px; line-height: 1; }
.phone-country .bi-chevron-down { font-size: 10px; color: var(--ink-muted); }

/* Footer line under the card */
.auth-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: clamp(14px, 2.2vh, 22px) 0 0;
  font-size: 13.5px;
  color: var(--ink-muted);
}
.auth-foot-sep { color: #c9b8bf; }


.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: clamp(14px, 2.2vh, 22px);
  transition: color .18s ease;
}
.auth-back:hover { color: var(--wine); }
.auth-back i { font-size: 14px; }

/* Role picker — 2x2 grid on desktop, single column on mobile */
.auth-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.role-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.role-option:hover {
  border-color: #d6bbc5;
  background: #fdfafb;
  box-shadow: 0 6px 20px rgba(84, 21, 42, .06);
}
.role-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.role-option:has(input:focus-visible) {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
}
.role-option.is-selected {
  border-color: var(--wine);
  background: linear-gradient(180deg, #fbf4f6 0%, var(--wine-tint) 100%);
  box-shadow: 0 0 0 3px var(--wine-glow), 0 8px 22px rgba(84, 21, 42, .08);
}
.role-option-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.role-option-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--wine-tint);
  color: var(--wine);
  font-size: 20px;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.role-option.is-selected .role-option-icon {
  background: var(--wine);
  color: #fff;
  box-shadow: 0 6px 14px rgba(84, 21, 42, .24);
}
.role-option-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1.5px solid #dfd2d7;
  background: #fff;
  color: transparent;
  font-size: 13px;
  flex-shrink: 0;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.role-option.is-selected .role-option-check {
  border-color: var(--wine);
  background: var(--wine);
  color: #fff;
}
.role-option-body { min-width: 0; }
.role-option-title {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0 0 6px;
}
.role-option-desc {
  display: block;
  font-size: 13.5px;
  line-height: 1.55;
  color: #664c55;
  margin: 0;
}

.auth-submit .bi-arrow-right {
  font-size: 16px;
  transition: transform .18s ease;
}
.auth-submit:hover .bi-arrow-right {
  transform: translateX(3px);
}

/* Checkbox */
.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 18px;
}
.auth-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--wine);
  flex-shrink: 0;
  cursor: pointer;
}
.auth-check label {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-muted);
}

/* Password strength */
.strength { margin-top: 10px; }
.strength-track { display: flex; gap: 5px; }
.strength-seg {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: var(--line);
  transition: background .2s ease;
}
.strength-label {
  display: block;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin-top: 7px;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: #a08d94;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

/* Success panel */
.auth-success { display: none; text-align: center; }
.auth-success.is-visible { display: block; }
.auth-success-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--success-tint);
  color: var(--success);
  font-size: 25px;
  margin: 0 auto 16px;
}
.auth-success-title { font-size: 18px; font-weight: 700; margin: 0 0 7px; }
.auth-success-text {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-muted);
  margin: 0 0 22px;
}
.auth-success-email {
  display: inline-block;
  font-weight: 700;
  color: var(--wine);
  word-break: break-all;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
  .auth-role-grid { grid-template-columns: 1fr; gap: 11px; }
  .role-option {
    flex-direction: row;
    align-items: flex-start;
    padding: 15px 16px;
    gap: 14px;
  }
  .role-option-top {
    width: auto;
    display: contents;
  }
  .role-option-check {
    order: 3;
    margin-left: auto;
    align-self: center;
  }
  .auth-topbar-back-text { display: none; }
  .auth-topbar-back { padding: 0; width: 44px; }
  .auth-submit-compact { width: 100%; min-width: 0; }
}

@media (max-width: 560px) {
  .auth-main { padding: 24px 16px; }
  .auth-signup .auth-main { padding: 0 16px 28px; }
  .auth-card { padding: 24px 20px 22px; border-radius: 22px; }
  .auth-title { font-size: 26px; }
  .auth-sub, .auth-sub-center { font-size: 14px; }
  .auth-brand { font-size: 21px; margin-bottom: 18px; }
  .auth-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .auth-brand .brand-mark svg { width: 22px; height: 22px; }
  .auth-form .form-control { height: 54px; font-size: 15px; }
  .auth-submit { height: 54px; font-size: 15px; }
  .auth-brand-inline { font-size: 20px; }
  .auth-brand-inline .brand-mark { width: 34px; height: 34px; }
  .auth-brand-inline .brand-mark svg { width: 20px; height: 20px; }
  .auth-lang { min-height: 40px; padding: 0 12px; font-size: 12.5px; }
  .auth-lang-flag { display: none; }
  .stepper-dot { width: 34px; height: 34px; font-size: 13px; }
  .stepper-line { top: 17px; }
  .stepper-label { font-size: 11.5px; }
  .phone-row { flex-wrap: wrap; }
  .auth-main { align-items: flex-start; }
  .auth-signup .auth-main { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-body * { transition: none !important; animation: none !important; }
}

/* ============================================================
   GLOBAL ERROR PAGE
   ============================================================ */

.error-wrap {
  max-width: 560px;
}

.error-card {
  text-align: center;
  padding: clamp(32px, 4.8vh, 48px) clamp(26px, 3.6vw, 44px);
}

.error-icon-wrap {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--wine-tint), var(--gold-tint));
  border: 1px solid var(--line);
  color: var(--wine);
  font-size: 30px;
  box-shadow: 0 8px 22px rgba(84, 21, 42, .08);
}

.error-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--wine-tint);
  color: var(--wine);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.error-code {
  font-variant-numeric: tabular-nums;
}

.error-badge-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.error-head {
  margin-bottom: 26px;
}

.error-title {
  font-size: clamp(24px, 3vw, 30px);
  margin-bottom: 10px;
  text-align: center;
}

.error-sub {
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
  color: var(--ink-muted);
  line-height: 1.65;
}

.error-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.error-actions .auth-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.error-btn-secondary {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-mid);
  font-weight: 600;
  font-size: 14.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.error-btn-secondary:hover {
  border-color: var(--wine);
  background: var(--wine-tint);
  color: var(--wine);
}

.error-ref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  text-align: left;
}

.error-ref-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.error-ref-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.error-ref-code {
  font-size: 12.5px;
  color: var(--ink-mid);
  word-break: break-all;
}

.error-copy-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-mid);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

.error-copy-btn:hover {
  border-color: var(--wine);
  color: var(--wine);
  background: var(--wine-tint);
}

.error-dev-details {
  margin-top: 16px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: #fcfafb;
  text-align: left;
  overflow: hidden;
}

.error-dev-details summary {
  padding: 11px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
}

.error-dev-details summary::-webkit-details-marker {
  display: none;
}

.error-dev-details[open] summary {
  border-bottom: 1px dashed var(--line);
  color: var(--wine);
}

.error-dev-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
}

.error-dev-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.error-dev-key {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-muted);
}

.error-dev-body code,
.error-dev-body p {
  margin: 0;
  color: var(--ink-mid);
  word-break: break-word;
}

.error-dev-hint {
  font-size: 11.5px;
  color: var(--ink-muted) !important;
  font-style: italic;
}

/* ============================================================
   PASSWORD RECOVERY & INBOX CONFIRMATION
   ============================================================ */

.auth-card-recovery {
  animation: recoveryCardRise .42s cubic-bezier(.22, 1, .36, 1) both;
}

.auth-card-recovery.is-sent {
  text-align: center;
}

@keyframes recoveryCardRise {
  from { opacity: 0; transform: translateY(12px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 3-step recovery stepper */
.recovery-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 0 clamp(20px, 3vh, 28px);
  padding: 0;
  list-style: none;
}

.recovery-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

.recovery-step-dot {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--line-soft);
  color: var(--ink-muted);
  border: 1.5px solid var(--line);
  transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.recovery-step.is-active {
  color: var(--wine);
}
.recovery-step.is-active .recovery-step-dot {
  background: var(--wine);
  border-color: var(--wine);
  color: #fff;
  box-shadow: 0 0 0 4px var(--wine-glow);
}

.recovery-step.is-done {
  color: var(--ink-mid);
}
.recovery-step.is-done .recovery-step-dot {
  background: var(--gold-tint);
  border-color: rgba(200, 151, 42, .45);
  color: #8f6514;
}

.recovery-step-line {
  flex: 1 1 26px;
  max-width: 44px;
  min-width: 14px;
  height: 1.5px;
  margin: 0 8px;
  background: var(--line);
  border-radius: 2px;
}
.recovery-step-line.is-done {
  background: linear-gradient(90deg, var(--gold), var(--wine));
}

/* Animated inbox emblem */
.inbox-emblem-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  margin: 4px auto 20px;
}

.inbox-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 24px;
  background: linear-gradient(145deg, #fffdf9 0%, var(--wine-tint) 100%);
  border: 1.5px solid rgba(200, 151, 42, .28);
  color: var(--wine);
  box-shadow:
    0 12px 28px rgba(84, 21, 42, .11),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  animation: emblemFloat 3.6s ease-in-out infinite;
}

.inbox-emblem::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 30px;
  border: 1px dashed rgba(200, 151, 42, .32);
  pointer-events: none;
  animation: emblemHalo 2.8s ease-out infinite;
}

.inbox-emblem-icon {
  font-size: 32px;
  line-height: 1;
  color: var(--wine);
}

.inbox-emblem-badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  font-size: 14px;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(47, 107, 82, .32);
  animation: badgePop .5s cubic-bezier(.34, 1.56, .64, 1) .18s both;
}

@keyframes emblemFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

@keyframes emblemHalo {
  0%   { opacity: .65; transform: scale(.96); }
  70%  { opacity: .15; transform: scale(1.06); }
  100% { opacity: 0;   transform: scale(1.09); }
}

@keyframes badgePop {
  from { opacity: 0; transform: scale(.35) rotate(-18deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Centered header for sent state */
.auth-card-recovery.is-sent .auth-card-head {
  text-align: center;
  margin-bottom: 20px;
}

.auth-card-recovery.is-sent .auth-title {
  margin-bottom: 8px;
}

.auth-card-recovery.is-sent .auth-sub {
  max-width: 38ch;
  margin: 0 auto;
}

/* Recipient email pill with copy interaction */
.recipient-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 14px auto 0;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: border-color .2s ease, background-color .2s ease;
}

.recipient-pill:hover {
  border-color: rgba(84, 21, 42, .24);
  background: #fdfbfc;
}

.recipient-pill-icon {
  color: var(--gold);
  font-size: 14px;
  flex-shrink: 0;
}

.recipient-pill-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipient-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-mid);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(84, 21, 42, .08);
  transition: background .18s ease, color .18s ease, transform .15s ease;
  flex-shrink: 0;
}

.recipient-copy-btn:hover {
  background: var(--wine-tint);
  color: var(--wine);
}
.recipient-copy-btn:active { transform: scale(.96); }
.recipient-copy-btn:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
}
.recipient-copy-btn.is-copied {
  background: var(--success-tint);
  color: var(--success);
}

/* Action stack on confirmation state */
.inbox-actions {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 22px;
}

.btn-inbox-provider {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink) !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease, color .2s ease;
}

.btn-inbox-provider:hover {
  border-color: rgba(84, 21, 42, .35);
  background: var(--wine-tint);
  color: var(--wine) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(84, 21, 42, .08);
}

.btn-inbox-provider:active { transform: scale(.99); }
.btn-inbox-provider:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
}

.btn-inbox-provider .bi-arrow-up-right {
  font-size: 13px;
  opacity: .75;
  transition: transform .2s ease;
}
.btn-inbox-provider:hover .bi-arrow-up-right {
  transform: translate(2px, -2px);
  opacity: 1;
}

.auth-submit .btn-arrow {
  font-size: 15px;
  transition: transform .2s ease;
}
.auth-submit:hover .btn-arrow {
  transform: translateX(3px);
}
.auth-submit:hover .btn-arrow-left {
  transform: translateX(-3px);
}

/* Resend + switch email utility row */
.resend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.resend-divider {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

.resend-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--wine);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color .18s ease, opacity .18s ease;
}

.resend-btn:hover:not(:disabled) {
  color: var(--wine-deep);
  text-decoration: underline;
}

.resend-btn:disabled {
  color: var(--ink-muted);
  cursor: not-allowed;
  font-weight: 500;
}

.resend-btn:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
  border-radius: 4px;
}

.resend-countdown-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--wine-tint);
  color: var(--wine);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Expandable troubleshooting tips */
.inbox-tips {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream);
  text-align: left;
  overflow: hidden;
  transition: border-color .2s ease;
}

.inbox-tips[open] {
  border-color: rgba(84, 21, 42, .2);
}

.inbox-tips-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-mid);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color .18s ease, background .18s ease;
}

.inbox-tips-summary::-webkit-details-marker { display: none; }

.inbox-tips-summary:hover {
  color: var(--wine);
  background: rgba(84, 21, 42, .03);
}

.inbox-tips-summary:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: -2px;
  border-radius: var(--radius-md);
}

.inbox-tips-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inbox-tips-title .bi {
  color: var(--gold);
  font-size: 15px;
}

.inbox-tips-chevron {
  font-size: 13px;
  color: var(--ink-muted);
  transition: transform .22s ease;
}

.inbox-tips[open] .inbox-tips-chevron {
  transform: rotate(180deg);
  color: var(--wine);
}

.inbox-tips-body {
  padding: 2px 16px 14px;
  border-top: 1px dashed var(--line);
}

.inbox-tips-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.inbox-tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
}

.inbox-tips-list li .bi {
  margin-top: 2px;
  font-size: 14px;
  color: var(--wine);
  flex-shrink: 0;
}

.inbox-tips-list strong {
  color: var(--ink-mid);
  font-weight: 600;
}

/* Resent confirmation banner */
.inbox-resent-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 14px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--success-tint);
  border: 1px solid rgba(47, 107, 82, .22);
  color: #24543f;
  font-size: 13px;
  font-weight: 600;
  animation: badgePop .35s cubic-bezier(.34, 1.56, .64, 1) both;
}

/* Request-form header icon pill */
.recovery-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.recovery-icon-chip {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fffdf9 0%, var(--wine-tint) 100%);
  border: 1px solid rgba(200, 151, 42, .26);
  color: var(--wine);
  font-size: 20px;
}

@media (max-width: 460px) {
  .recovery-step-label { display: none; }
  .recovery-step-line { max-width: 56px; }
  .recipient-pill { font-size: 13px; padding: 6px 6px 6px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card-recovery,
  .inbox-emblem,
  .inbox-emblem::before,
  .inbox-emblem-badge,
  .inbox-resent-banner {
    animation: none !important;
  }
  .btn-inbox-provider,
  .auth-submit,
  .inbox-tips-chevron,
  .recipient-copy-btn {
    transition: none !important;
  }
}
