/*
 * Auth pages — login, forgot password, verify reset PIN.
 * Two-column layout on ≥768px (illustration left, form right);
 * single-card layout with image-on-top on smaller screens.
 */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #ffffff;
  color: #111827;
  min-height: 100vh;
}

.login-page {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Mobile: stack on a soft gradient and center a card */
@media (max-width: 767.98px) {
  body {
    background:
      radial-gradient(60vw 60vw at 20% 20%, rgba(165,180,252,.45), transparent 60%),
      radial-gradient(50vw 50vw at 80% 80%, rgba(196,181,253,.35), transparent 60%),
      #f8fafc;
  }
  .login-page {
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
  }
}

/* ---------- Left side: illustration ---------- */
.login-illustration {
  display: none;
  flex: 1;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #c7d2fe 100%);
  position: relative;
  overflow: hidden;
}
.login-illustration::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 30% 30%, rgba(129, 140, 248, .35), transparent 60%),
    radial-gradient(50% 50% at 70% 70%, rgba(139, 92, 246, .28), transparent 60%);
  pointer-events: none;
}
.login-illustration img {
  position: relative; z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 3rem;
  filter: drop-shadow(0 22px 40px rgba(99, 102, 241, .25));
}
.login-illustration .brand-tag {
  position: absolute;
  top: 1.75rem;
  left: 1.75rem;
  z-index: 2;
  display: inline-flex; align-items: center; gap: .55rem;
  color: #4338ca;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .02em;
}
.login-illustration .brand-tag .brand-mark {
  width: 32px; height: 32px; border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-weight: 700; font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(99, 102, 241, .3);
}
@media (min-width: 768px) {
  .login-illustration { display: block; }
}

/* ---------- Right side: form ---------- */
.login-form-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}
/* On mobile, wrap the form in a glass card with the image on top. */
@media (max-width: 767.98px) {
  .login-form-wrap {
    flex: 0 1 auto;
    width: 100%; max-width: 26rem;
    padding: 2rem 1.75rem 2.25rem;
    background: rgba(255,255,255,.85);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(17, 24, 39, .15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

/* Mobile-only image-on-top of the card */
.mobile-illustration {
  display: none;
  width: 130px; height: 130px;
  margin: 0 auto 1rem;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(99, 102, 241, .3));
}
@media (max-width: 767.98px) {
  .mobile-illustration { display: block; }
}

/* Mobile-only brand row above the form */
.mobile-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  margin-bottom: 1.5rem;
  color: #4338ca;
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.mobile-brand .brand-mark {
  width: 28px; height: 28px; border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-weight: 700; font-size: .78rem;
  display: inline-flex; align-items: center; justify-content: center;
}
@media (min-width: 768px) {
  .mobile-brand { display: none; }
}

.login-form {
  width: 100%;
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

h2.welcome {
  font-size: 2.25rem;
  font-weight: 500;
  color: #111827;
  margin: 0;
  letter-spacing: -0.02em;
  text-align: center;
}
p.subtitle {
  font-size: .875rem;
  color: rgba(107, 114, 128, .9);
  margin: .75rem 0 0;
  text-align: center;
}

/* Flash messages */
.flash-stack { margin-top: 1.5rem; display: flex; flex-direction: column; gap: .5rem; }
.flash {
  padding: .75rem 1rem;
  border-radius: .65rem;
  font-size: .875rem;
  font-weight: 500;
  display: flex; align-items: center; gap: .55rem;
  border: 1px solid;
}
.flash i { font-size: .95rem; flex-shrink: 0; }
.flash.error, .flash.danger {
  background: #fef2f2; border-color: #fecaca; color: #b91c1c;
}
.flash.success {
  background: #f0fdf4; border-color: #bbf7d0; color: #166534;
}
.flash.info, .flash.message, .flash.warning {
  background: #fffbeb; border-color: #fde68a; color: #92400e;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin: 1.25rem 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(209, 213, 219, .9);
}
.divider-text {
  white-space: nowrap;
  font-size: .875rem;
  color: rgba(107, 114, 128, .9);
}

/* Pill inputs */
.field-block { margin-top: 1.5rem; }
.field-block:first-of-type { margin-top: 0; }
.field {
  display: flex;
  align-items: center;
  width: 100%;
  height: 3rem;
  padding: 0 1.5rem;
  gap: .55rem;
  background: transparent;
  border: 1px solid rgba(209, 213, 219, .6);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}
.field svg { flex-shrink: 0; color: #6b7280; }
.field i.field-icon { color: #6b7280; flex-shrink: 0; font-size: .9rem; }
.field input {
  flex: 1;
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
  outline: none;
  font-family: inherit;
  font-size: .875rem;
  color: rgba(75, 85, 99, .95);
}
.field input::placeholder { color: rgba(107, 114, 128, .8); }
.field-error {
  font-size: .75rem;
  color: #b91c1c;
  margin: .35rem 0 0 1.5rem;
}

/* PIN-specific field — wider letter-spacing for the 6-digit code */
.field input.pin-input {
  letter-spacing: .5em;
  text-align: center;
  font-weight: 600;
  font-size: 1.05rem;
  color: #111827;
}

/* Row: remember me + forgot password */
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 2rem;
  color: rgba(107, 114, 128, .85);
  font-size: .875rem;
}
.row-between .remember {
  display: inline-flex; align-items: center; gap: .5rem;
  cursor: pointer;
}
.row-between .remember input[type="checkbox"] {
  width: 1rem; height: 1rem;
  accent-color: #6366f1;
  cursor: pointer;
}
.row-between a {
  color: rgba(107, 114, 128, .85);
  text-decoration: underline;
}
.row-between a:hover { color: #4f46e5; }

/* Submit */
.btn-primary {
  width: 100%;
  margin-top: 2rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #6366f1;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: opacity .2s ease;
}
.btn-primary:hover { opacity: .9; }
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .35);
}

.footnote {
  margin-top: 1rem;
  text-align: center;
  font-size: .875rem;
  color: rgba(107, 114, 128, .9);
}
.footnote a { color: #818cf8; text-decoration: none; }
.footnote a:hover { text-decoration: underline; }

/* Hidden label text — labels live as placeholders */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Recipient chip — shown on the verify-reset-pin page */
.recipient-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-top: .75rem;
  padding: .35rem .8rem;
  background: rgba(99, 102, 241, .08);
  border: 1px solid rgba(99, 102, 241, .2);
  border-radius: 999px;
  font-size: .82rem;
  color: #4338ca;
  align-self: center;
}
