/* Sign-in screens. Self-contained: no Bootstrap needed. */
:root {
  --navy-950: #050816;
  --navy-900: #0b1437;
  --navy-800: #121d4a;
  --navy-700: #1b2a63;
  --accent: #4f6bff;
  --accent-soft: rgba(79, 107, 255, 0.18);
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-line: #fecdca;
  --radius: 12px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Brand panel ---------- */
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  color: #fff;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(79, 107, 255, 0.28) 0%, rgba(79, 107, 255, 0) 55%),
    linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 60%, var(--navy-800) 100%);
}

/* Oversized H mark as a quiet watermark */
.auth-brand::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -70px;
  width: 380px;
  height: 551px;
  background: url("../images/hamzpay-mark-white.png") no-repeat center / contain;
  opacity: 0.05;
  pointer-events: none;
}

.auth-brand > * { position: relative; z-index: 1; }

.auth-brand__logo { height: 34px; width: auto; display: block; align-self: flex-start; }

/* logo stays at the top, copy sits in the vertical middle */
.auth-brand__body { max-width: 440px; margin-block: auto; }

.auth-eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.04);
}

.auth-brand h2 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-brand__lead {
  margin: 0 0 32px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
}

.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }

.auth-points li { display: flex; align-items: flex-start; gap: 14px; }

.auth-points__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-points svg { width: 18px; height: 18px; }

.auth-points strong { display: block; font-weight: 600; font-size: 15px; }

.auth-points span { font-size: 13.5px; color: rgba(255, 255, 255, 0.6); }

/* ---------- Form panel ---------- */
.auth-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 24px 32px;
  background: var(--surface);
}

.auth-card { width: 100%; max-width: 380px; }

.auth-topbar { display: none; }

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-card__intro { margin: 0 0 28px; color: var(--ink-2); }

.auth-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px solid var(--danger-line);
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
}

.auth-alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.field__control { position: relative; }

.field__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder { color: var(--ink-3); }

.field input:hover { border-color: #cbd5e1; }

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field input:focus + .field__icon,
.field__control:focus-within .field__icon { color: var(--accent); }

.field--password input { padding-right: 48px; }

.reveal {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}

.reveal:hover { color: var(--ink); background: var(--canvas); }

.reveal:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); color: var(--ink); }

.reveal svg { width: 18px; height: 18px; }

.reveal .icon-hide { display: none; }

.reveal[aria-pressed="true"] .icon-show { display: none; }

.reveal[aria-pressed="true"] .icon-hide { display: block; }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 50px;
  margin-top: 26px;
  border: 0;
  border-radius: 10px;
  background: var(--navy-900);
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(5, 8, 22, 0.2), 0 8px 20px -8px rgba(11, 20, 55, 0.6);
}

.btn-primary:hover { background: var(--navy-700); }

.btn-primary:active { transform: translateY(1px); }

.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }

.btn-primary svg { width: 18px; height: 18px; }

.btn-primary .spinner { display: none; }

.btn-primary[aria-busy="true"] { cursor: progress; background: var(--navy-700); }

.btn-primary[aria-busy="true"] .spinner { display: block; animation: spin 0.8s linear infinite; }

.btn-primary[aria-busy="true"] .arrow { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.auth-secure {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 22px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--canvas);
  color: var(--ink-2);
  font-size: 13px;
}

.auth-secure svg { flex: none; width: 18px; height: 18px; color: var(--navy-700); }

.auth-help { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--ink-3); }

.auth-footer { margin-top: 40px; font-size: 12.5px; color: var(--ink-3); text-align: center; }

/* ---------- Verification steps (2FA pages) ---------- */
.auth-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }

.auth-steps li { position: relative; display: flex; gap: 14px; padding-bottom: 22px; }

.auth-steps li:last-child { padding-bottom: 0; }

/* connector line between step markers */
.auth-steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.auth-steps li.is-done:not(:last-child)::before { background: rgba(79, 107, 255, 0.7); }

.auth-steps__marker {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.auth-steps__marker svg { width: 16px; height: 16px; }

.auth-steps li.is-done .auth-steps__marker { border-color: var(--accent); background: var(--accent); color: #fff; }

.auth-steps li.is-current .auth-steps__marker {
  border-color: #fff;
  color: var(--navy-900);
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.12);
}

.auth-steps strong { display: block; font-weight: 600; font-size: 15px; line-height: 32px; }

.auth-steps div span { display: block; margin-top: -4px; font-size: 13.5px; color: rgba(255, 255, 255, 0.6); }

.auth-steps li:not(.is-done):not(.is-current) strong { color: rgba(255, 255, 255, 0.7); }

/* ---------- One-time code entry ---------- */
.auth-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: #eef1ff;
  color: var(--navy-800);
}

.auth-badge svg { width: 26px; height: 26px; }

.auth-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: -12px 0 24px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.auth-account__avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy-900);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-account span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

input.otp-input {
  width: 100%;
  height: 64px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-indent: 0.5em; /* balances the trailing letter-spacing so digits stay centred */
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input.otp-input::placeholder { color: #cbd5e1; letter-spacing: 0.5em; }

input.otp-input:hover { border-color: #cbd5e1; }

input.otp-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

input.otp-input[aria-invalid="true"] { border-color: #f04438; }

.otp-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-3);
}

.otp-hint svg { flex: none; width: 15px; height: 15px; }

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 0;
  font-size: 13.5px;
}

.auth-links a { color: var(--navy-700); font-weight: 600; text-decoration: none; }

.auth-links a:hover { text-decoration: underline; }

.auth-links span { color: var(--ink-3); }

/* ---------- SMS code page ---------- */
.auth-alert--success { border-color: #abefc6; background: #ecfdf3; color: #067647; }

.otp-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

.otp-timer svg { flex: none; width: 15px; height: 15px; color: var(--ink-3); }

.otp-timer strong { font-variant-numeric: tabular-nums; color: var(--ink); }

.otp-timer.is-expired, .otp-timer.is-expired strong, .otp-timer.is-expired svg { color: var(--danger); }

.auth-resend {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.auth-resend p { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--navy-900);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn-secondary:hover:not(:disabled) { border-color: #cbd5e1; background: var(--canvas); }

.btn-secondary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }

.btn-secondary:disabled { color: var(--ink-3); cursor: not-allowed; }

.btn-secondary svg { width: 16px; height: 16px; }

.btn-secondary.is-highlight { border-color: var(--navy-900); }

/* ---------- Small screens: brand panel becomes a header ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-main { justify-content: flex-start; padding: 0 0 24px; background: var(--canvas); }
  .auth-topbar {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 30px 16px 70px;
    background:
      radial-gradient(120% 120% at 100% 0%, rgba(79, 107, 255, 0.28) 0%, rgba(79, 107, 255, 0) 60%),
      linear-gradient(135deg, var(--navy-950), var(--navy-900));
  }
  .auth-topbar img { height: 28px; width: auto; }
  .auth-card {
    width: calc(100% - 32px);
    max-width: 440px;
    margin-top: -44px;
    padding: 28px 22px 26px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.35);
  }
  .auth-card h1 { font-size: 24px; }
  .auth-footer { margin-top: 24px; }
}

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