/* ============================================================
   eHub SMS · Auth pages (Login + Register)
   Layered on top of landing.css for tokens, buttons, etc.
   ============================================================ */

/* ── Page shell ───────────────────────────────────────────── */
.auth-shell {
  height: 100vh;
  background: var(--cream);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  position: relative;
  overflow: hidden;
}

.auth-form-side {
  display: flex;
  flex-direction: column;
  padding: 28px clamp(28px, 5vw, 72px);
  position: relative;
  overflow-y: auto;
  background: var(--cream);
}
.auth-form-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--magenta-100) 1.5px, transparent 2px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 80% 60% at 20% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 20% 30%, #000 0%, transparent 70%);
  opacity: .6;
  pointer-events: none;
}
.auth-form-side > * { position: relative; z-index: 1; }

.auth__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(16px, 3vh, 32px);
}
.auth__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth__brand img { height: 36px; width: auto; }

.auth__altcta {
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth__altcta a { color: var(--magenta-700); font-weight: 700; }
.auth__altcta a:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth__card {
  width: 100%;
  max-width: 460px;
  margin: auto 0;
  padding: 8px 0;
}

.auth h1 + .auth__sub { margin-top: 6px; }

.auth__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--magenta-700);
  margin-bottom: 12px;
}
.auth__eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--gold-500);
}

.auth h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 6px;
}
.auth h1 .accent { color: var(--magenta-700); }
.auth__sub {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0 0 16px;
  max-width: 44ch;
}
.auth__sub a { color: var(--magenta-700); font-weight: 600; }
.auth__sub a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Form ─────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.field--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.field__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.field__label .hint { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.field__label .forgot { font-size: 12px; color: var(--magenta-700); font-weight: 600; }
.field__label .forgot:hover { text-decoration: underline; text-underline-offset: 3px; }
.field__input-wrap { position: relative; }
.field__input,
.field__select {
  width: 100%;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 9px 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field__input::placeholder { color: var(--ink-3); font-weight: 400; }
.field__input:hover { border-color: rgba(27, 8, 16, 0.22); }
.field__input:focus,
.field__select:focus {
  outline: none;
  border-color: var(--magenta-700);
  box-shadow: 0 0 0 4px rgba(138, 26, 85, 0.12);
}

/* Browser autofill: keep our white bg + ink text. Chrome overrides bg via
   ::-webkit-autofill, so we use inset box-shadow + -webkit-text-fill-color. */
.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus,
.field__input:-webkit-autofill:active,
.field__select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink);
  transition: background-color 5000s ease-in-out 0s;
}
.field__input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset, 0 0 0 4px rgba(138, 26, 85, 0.12) !important;
  box-shadow: 0 0 0 1000px #fff inset, 0 0 0 4px rgba(138, 26, 85, 0.12) !important;
}
.field--has-prefix .field__input { padding-left: 92px; }
.field--has-suffix .field__input { padding-right: 44px; }
.field__prefix {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  background: var(--cream-2);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.field__prefix .flag {
  width: 18px; height: 12px;
  border-radius: 2px;
  background: linear-gradient(to bottom,
    #1eb53a 0 33%, #fcd116 33% 39%, #00a3dd 39% 61%, #fcd116 61% 67%, #000 67% 100%);
}
.field__suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  transition: background .12s, color .12s;
}
.field__suffix:hover { background: rgba(27,8,16,0.05); color: var(--ink); }

.field__msg {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 1px;
  line-height: 1.4;
}
.field__msg.is-error { color: #d9534f; }
.field__msg.is-success { color: #15803d; }

/* Password strength */
.pw-strength { display: flex; gap: 4px; margin-top: 6px; }
.pw-strength__bar {
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(27,8,16,0.08);
  transition: background .25s;
}
.pw-strength[data-score="1"] .pw-strength__bar:nth-child(-n+1) { background: #d9534f; }
.pw-strength[data-score="2"] .pw-strength__bar:nth-child(-n+2) { background: #f0a020; }
.pw-strength[data-score="3"] .pw-strength__bar:nth-child(-n+3) { background: var(--gold-500); }
.pw-strength[data-score="4"] .pw-strength__bar:nth-child(-n+4) { background: #22c55e; }
.pw-strength__lbl {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink-3);
  margin-top: 4px;
}

/* Checkbox */
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  margin-top: 1px;
  transition: background .15s, border-color .15s;
}
.check input[type="checkbox"]:hover { border-color: var(--magenta-700); }
.check input[type="checkbox"]:checked {
  background: var(--magenta-700);
  border-color: var(--magenta-700);
}
.check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/12px no-repeat;
}
.check a { color: var(--magenta-700); font-weight: 600; }
.check a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Submit */
.auth__submit {
  width: 100%;
  justify-content: center;
  padding: 13px 22px;
  margin-top: 4px;
  font-size: 15px;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 2px 0;
  color: var(--ink-3);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* OAuth */
.oauth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.oauth__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line-2);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color .15s, background .15s, transform .12s;
  cursor: pointer;
}
.oauth__btn:hover {
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.oauth__btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

.auth__foot {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-3);
  gap: 12px;
  flex-wrap: wrap;
}
.auth__foot a { color: var(--ink-2); font-weight: 500; }
.auth__foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   BRAND RAIL (right side)
   ============================================================ */
.auth-brand-side {
  position: relative;
  background: var(--plum-900);
  background-image:
    radial-gradient(ellipse 700px 600px at 80% 20%, rgba(176,38,100,0.45), transparent 60%),
    radial-gradient(ellipse 600px 500px at 10% 90%, rgba(229,168,35,0.16), transparent 60%);
  color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 56px clamp(28px, 4vw, 64px);
}
.auth-brand-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1.2px, transparent 1.6px);
  background-size: 22px 22px;
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
.auth-brand-side > * { position: relative; z-index: 1; }

.brand-rail__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}
.brand-rail__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-300);
}
.brand-rail__chip .dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--gold-500);
}
.brand-rail__live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.28);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4ade80;
}
.brand-rail__live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18);
  animation: pulse-live 1.6s ease-in-out infinite;
}

.brand-rail__headline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: #fff;
  max-width: 14ch;
}
.brand-rail__headline .accent { color: var(--gold-400); }

.brand-rail__sub {
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.5;
  color: rgba(255,255,255,0.7);
  max-width: 38ch;
}

.brand-rail__demo {
  margin: auto 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

/* Mini phone preview */
.mini-phone {
  width: 220px;
  height: 340px;
  background: #0e0c10;
  border-radius: 36px;
  padding: 9px;
  position: relative;
  box-shadow:
    0 30px 80px -20px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.06) inset;
  transform: rotate(-4deg);
}
.mini-phone__screen {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #fffdf6 0%, #faf3e1 100%);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
}
.mini-phone__notch {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 68px; height: 16px;
  background: #0e0c10;
  border-radius: 999px;
  z-index: 2;
}
.mini-phone__sms {
  padding: 38px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}
.mini-phone__hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(27, 8, 16, 0.06);
}
.mini-phone__avatar {
  width: 26px; height: 26px;
  border-radius: 999px;
  background: var(--magenta-700);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 11px;
}
.mini-phone__name {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}
.mini-phone__time {
  font-size: 9px;
  color: var(--ink-3);
}
.mini-phone__bubble {
  display: inline-block;
  padding: 8px 11px;
  font-size: 11px;
  line-height: 1.3;
  border-radius: 14px;
  max-width: 90%;
}
.mini-phone__bubble.in {
  background: #ece6db;
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.mini-phone__bubble.out {
  background: var(--magenta-700);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Floating proof cards */
.brand-rail__proof {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 14px 18px;
  color: #fff;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-rail__proof--top {
  top: 12px;
  right: -10px;
  transform: rotate(3deg);
}
.brand-rail__proof--bot {
  bottom: 8px;
  left: -10px;
  transform: rotate(-3deg);
}
.brand-rail__proof__big {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gold-400);
  line-height: 1;
}
.brand-rail__proof__lbl {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  margin-top: 2px;
}

.brand-rail__trust {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}
.brand-rail__trust-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}
.brand-rail__trust-row .ic {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(229,168,35,0.16);
  color: var(--gold-400);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.brand-rail__trust-row strong { color: #fff; font-weight: 700; }

.brand-rail__foot {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.brand-rail__foot .stars { color: var(--gold-400); letter-spacing: 1px; }

/* ============================================================
   STEP RAIL — Register
   ============================================================ */
.step-rail {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.step-rail__dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(27,8,16,0.08);
  position: relative;
  overflow: hidden;
}
.step-rail__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--magenta-700);
  transform: translateX(-100%);
  transition: transform .25s ease;
}
.step-rail__dot.is-done::after { transform: translateX(0); }
.step-rail__dot.is-active::after {
  transform: translateX(0);
  background: linear-gradient(90deg, var(--magenta-700) 0% 50%, rgba(138,26,85,0.25) 50% 100%);
}
.step-rail__lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 18px;
}
.step-rail__lbl strong { color: var(--magenta-700); font-weight: 800; }

/* OTP boxes */
.otp-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 4px 0;
}
.otp-box {
  height: 56px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.otp-box:focus {
  outline: none;
  border-color: var(--magenta-700);
  box-shadow: 0 0 0 4px rgba(138, 26, 85, 0.12);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes auth-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes auth-slide-left {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes auth-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.auth__eyebrow {
  animation: auth-fade-up 0.5s ease-out both;
}
.auth h1 {
  animation: auth-fade-up 0.5s ease-out 0.08s both;
}
.auth__sub {
  animation: auth-fade-up 0.5s ease-out 0.14s both;
}
.auth-form {
  animation: auth-fade-up 0.5s ease-out 0.22s both;
}
.auth-form .field:nth-child(1) { animation: auth-fade-up 0.4s ease-out 0.28s both; }
.auth-form .field:nth-child(2) { animation: auth-fade-up 0.4s ease-out 0.34s both; }
.auth-form .field:nth-child(3) { animation: auth-fade-up 0.4s ease-out 0.40s both; }
.auth-form .field:nth-child(4) { animation: auth-fade-up 0.4s ease-out 0.46s both; }
.auth-form .field:nth-child(5) { animation: auth-fade-up 0.4s ease-out 0.52s both; }
.auth-form .check { animation: auth-fade-in 0.4s ease-out 0.50s both; }
.auth-form .auth__submit { animation: auth-scale-in 0.4s ease-out 0.56s both; }
.auth-form .auth__foot { animation: auth-fade-in 0.4s ease-out 0.62s both; }

.auth-brand-side {
  animation: auth-slide-left 0.6s ease-out 0.1s both;
}
.brand-rail__headline {
  animation: auth-fade-up 0.5s ease-out 0.3s both;
}
.brand-rail__sub {
  animation: auth-fade-up 0.5s ease-out 0.4s both;
}
.brand-rail__demo {
  animation: auth-scale-in 0.6s ease-out 0.5s both;
}
.brand-rail__trust {
  animation: auth-fade-up 0.5s ease-out 0.6s both;
}
.brand-rail__proof--top {
  animation: auth-fade-up 0.5s ease-out 0.55s both;
}
.brand-rail__proof--bot {
  animation: auth-fade-up 0.5s ease-out 0.65s both;
}
.mini-phone {
  animation: auth-scale-in 0.7s ease-out 0.45s both;
}

/* Subtle hover lift on submit button */
.auth__submit {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.auth__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(138, 26, 85, 0.25);
}
.auth__submit:active {
  transform: translateY(0);
}

/* Input focus animation */
.field__input {
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field__input:focus {
  border-color: var(--magenta-700);
  box-shadow: 0 0 0 4px rgba(138, 26, 85, 0.08);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .auth__eyebrow, .auth h1, .auth__sub, .auth-form,
  .auth-form .field, .auth-form .check, .auth-form .auth__submit,
  .auth-form .auth__foot, .auth-brand-side, .brand-rail__headline,
  .brand-rail__sub, .brand-rail__demo, .brand-rail__trust,
  .brand-rail__proof--top, .brand-rail__proof--bot, .mini-phone {
    animation: none !important;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .auth-brand-side { display: none; }
  .auth-form-side { min-height: 100vh; padding: 32px 24px; }
}

@media (max-width: 540px) {
  .field--row { grid-template-columns: 1fr; }
  .oauth { grid-template-columns: 1fr; }
  .otp-row { gap: 6px; }
  .otp-box { height: 50px; font-size: 18px; }
}
