/* ==========================================================
   VIBE Portal — auth pages stylesheet (login / reset password)
   Self-contained: no Tailwind, no CDN, no web-font dependency.
   Change the look of the page by editing only the :root tokens.
   ========================================================== */

:root {
  --blue:        #4a6cf7;
  --blue-dark:   #1d4ed8;
  --blue-soft:   #eff6ff;
  --indigo-soft: #e0e7ff;
  --green:       #10b981;
  --green-dark:  #059669;
  --green-soft:  #f0fdf4;
  --amber:       #f59e0b;
  --red:         #ef4444;
  --ink:         #111827;
  --ink-2:       #374151;
  --muted:       #6b7280;
  --faint:       #9ca3af;
  --line:        #e5e7eb;
  --card:        #ffffff;
  --radius-lg:   16px;
  --radius-md:   12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Telugu", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  color: var(--ink);
  /* solid colour first, so the page is never white even if gradients fail */
  background-color: var(--blue-soft);
  background-image: linear-gradient(135deg, var(--blue-soft), var(--indigo-soft));
  background-attachment: fixed;
}

/* ---------- startup overlay ---------- */
#loginStartup {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--blue-soft);
  background-image: linear-gradient(135deg, var(--blue-soft), var(--indigo-soft));
}
#loginStartup.hidden { display: none; }
#loginStartup .spinner {
  width: 38px; height: 38px;
  border: 4px solid rgba(74, 108, 247, .2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: vibeSpin .8s linear infinite;
}
@keyframes vibeSpin { to { transform: rotate(360deg); } }

/* ---------- card ---------- */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 448px;
  padding: 32px;
  background: var(--card);
  border: 1px solid #f3f4f6;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
}

.hub-link {
  position: absolute; top: 16px; right: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: #2563eb; color: #fff;
  font-size: .75rem; font-weight: 600; text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .15);
  transition: background .2s, transform .2s;
}
.hub-link:hover { background: var(--blue-dark); transform: translateY(-1px); }

.auth-head { text-align: center; margin: 28px 0 24px; }
.auth-head h1 {
  margin: 0;
  font-size: 1.875rem; font-weight: 800; letter-spacing: -.025em; color: var(--ink);
}
.auth-head p { margin: 4px 0 0; font-size: .875rem; color: var(--muted); }

/* ---------- panes ---------- */
.pane { display: none; }
.pane.active { display: block; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 24px; }

/* ---------- form fields ---------- */
.field label {
  display: block; margin-bottom: 4px;
  font-size: .75rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-2);
}
.input-wrap { position: relative; }
.input-wrap > .icon {
  position: absolute; top: 0; bottom: 0; left: 0;
  display: flex; align-items: center; padding-left: 12px;
  color: var(--faint); pointer-events: none;
}
.input {
  display: block; width: 100%;
  padding: 12px 16px 12px 40px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.input.has-toggle { padding-right: 44px; }

.toggle-eye {
  position: absolute; top: 0; bottom: 0; right: 0;
  width: 44px; border: 0; background: none; cursor: pointer;
  color: var(--faint);
}
.toggle-eye:hover { color: var(--ink-2); }

.hint { margin: 6px 0 0; font-size: .75rem; color: var(--muted); }
.hint.bad  { color: var(--red); }
.hint.good { color: var(--green-dark); }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 48px;
  font: inherit; font-weight: 700; color: #fff;
  border: 0; border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .12);
  transition: transform .1s, opacity .2s, box-shadow .2s;
}
.btn:active:not(:disabled) { transform: scale(.99); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background-color: var(--blue-dark); background-image: linear-gradient(135deg, var(--blue), var(--blue-dark)); }
.btn-success { background-color: var(--green-dark); background-image: linear-gradient(135deg, var(--green), var(--green-dark)); }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: .8125rem; font-weight: 600; color: #2563eb;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--faint); cursor: not-allowed; text-decoration: none; }

.row-between { display: flex; align-items: center; justify-content: flex-end; margin-top: 8px; }

.back-btn {
  display: block; width: 100%; padding-top: 8px;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: .75rem; font-weight: 500; color: var(--faint);
  text-align: center;
}
.back-btn:hover { color: var(--muted); }

.foot { text-align: center; font-size: .875rem; padding-top: 8px; color: var(--muted); }
.foot a { color: #2563eb; font-weight: 600; text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ---------- OTP pane ---------- */
.otp-head { text-align: center; }
.otp-badge {
  width: 56px; height: 56px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; color: #2563eb;
  background: var(--blue-soft); border-radius: 50%;
}
.otp-head h2 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--ink-2); }
.otp-head p  { margin: 4px 0 0; font-size: .875rem; color: var(--muted); }
.otp-head p b { color: var(--ink-2); }

.otp-timer { margin-top: 8px; font-size: .78rem; color: var(--muted); }
.otp-timer .resend-link {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  color: var(--blue); text-decoration: underline; cursor: pointer;
}
.otp-timer .resend-link:disabled { color: var(--faint); cursor: not-allowed; text-decoration: none; }

.otp-row { display: flex; justify-content: space-between; gap: 4px; }
.otp-input {
  width: 46px; height: 52px; padding: 0;
  text-align: center; font: inherit; font-size: 1.4rem; font-weight: 700; color: var(--ink);
  background: #fff;
  border: 2px solid var(--line); border-radius: var(--radius-md);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.otp-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74, 108, 247, .15); }
.otp-input-filled { border-color: var(--green); background: var(--green-soft); }

/* ---------- reCAPTCHA (invisible) ---------- */
.recaptcha-wrapper { min-height: 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 9999;
  max-width: 360px; padding: 14px 24px;
  font-size: .9rem; font-weight: 600; color: #fff;
  background: #2563eb;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  transform: translateY(100px); opacity: 0;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), opacity .3s;
}
.toast.show    { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.warning { background: var(--amber); }

/* ---------- small screens ---------- */
@media (max-width: 420px) {
  .auth-card { padding: 24px 18px; }
  .otp-input { width: 40px; height: 48px; font-size: 1.25rem; }
  .toast { left: 12px; right: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
