/* ---- Theme & font ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root{
  --primary: #2563eb;         /* brand blue */
  --primary-600:#1e4fd6;
  --primary-700:#163fb3;
  --ink: #0f172a;              /* heading/body */
  --muted:#64748b;             /* secondary text */
  --ring: rgba(37, 99, 235, .35);
  --card: rgba(255,255,255,.72); /* glass card */
  --stroke: rgba(15, 23, 42, .06);
  --soft-shadow: 0 10px 30px rgba(15,23,42,.12);
  --soft-shadow-lg: 0 25px 50px rgba(15,23,42,.18);
  --radius: 14px;
}

/* ---- Reset ---- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", sans-serif;
  margin: 0;
  display: flex;            
  justify-content: center;
  align-items: center;

  /* Prevent accidental horizontal scroll without hiding vertical scrolling */
  overflow-x: clip;
  position: relative; /* create stacking context for body::before/after */

  background:
    radial-gradient(1000px 800px at 10% -10%, #c7d2fe 0%, rgba(199,210,254,0) 60%),
    radial-gradient(900px 700px at 110% 110%, #bde5ff 0%, rgba(189,229,255,0) 55%),
    linear-gradient(180deg, #eaf1ff 0%, #ddeafc 100%);
  color: var(--ink);
}

/* Decorative blobs: FIXED to viewport, behind content (no clipping, no scrollbars) */
body::before,
body::after{
  content:"";
  position: fixed;
  z-index: -1;              /* behind everything */
  filter: blur(40px);
  opacity:.45;
  pointer-events: none;
  transform: translateZ(0);
}

/* top-left blob */
body::before{
  width: min(36vw, 360px);
  height: min(36vw, 360px);
  left: max(-6vw, -60px);
  top:  max(-6vh, -60px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #dbeafe, #e9d5ff 60%, transparent 70%);
}

/* bottom-right blob */
body::after{
  width: min(40vw, 420px);
  height: min(40vw, 420px);
  right: max(-6vw, -60px);
  bottom: max(-6vh, -60px);
  border-radius: 50%;
  background: radial-gradient(circle at 70% 70%, #bae6fd, #c7d2fe 60%, transparent 70%);
}

/* ---- Brand side ---- */
.auth-shell { 
  display: flex;
  gap: 32px;
  padding: 24px;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  isolation: isolate;
}

.brand-panel {
  flex: 1;
  max-width: 560px;
  border-radius: calc(var(--radius) + 6px);
  padding: 42px 32px;
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(255,255,255,.68), rgba(255,255,255,.46));
  border: 1px solid var(--stroke);
  box-shadow: var(--soft-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-inner { text-align: center; }

.brand-logo {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-bottom: 18px;
  filter: drop-shadow(0 6px 14px rgba(15,23,42,.12));
}

.brand-title {
  margin: 0 0 10px;
  font-size: 34px;
  letter-spacing: .2px;
  line-height: 1.15;
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 40%, var(--primary) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-tagline {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 520px;
  font-weight: 500;
}

/* ---- Auth card ---- */
.container {
  flex: 1.1;
  max-width: 520px;
  width: 100%;
  min-height: 620px;
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--stroke);
  box-shadow: var(--soft-shadow-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* Keep your original slide transition exactly */
.form-container {
  display: flex;
  width: 200%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
  transition: transform 0.5s ease-in-out;
  transform: translateX(0);
}
.container.signup-mode .form-container { transform: translateX(-50%); }

/* Panels */
.form {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px 26px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78)),
    radial-gradient(1600px 300px at 50% -10%, rgba(37,99,235,.06), transparent 60%);
}

/* Section heading with accent underline */
h2 {
  text-align: center;
  margin: 0 0 22px;
  font-size: 24px;
  font-weight: 700;
  position: relative;
  color: #0f172a;
}
h2::after{
  content:"";
  position:absolute;
  left:50%; bottom:-8px;
  width: 64px; height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  transform: translateX(-50%);
  opacity:.9;
}

/* ---- Inputs ---- */
.input-group {
  margin-bottom: 16px;
  position: relative;
  width: 100%;
}

.input-group.full-row {
  display: flex;
  justify-content: space-between;
  gap: 4%;
}

.input-group.full-row .half {
  width: 48%;
  position: relative;
}

.input-group input {
  width: 100%;
  padding: 14px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: rgba(255,255,255,.9);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  box-shadow: inset 0 1px 0 rgba(15,23,42,.03);
}

.input-group input:hover {
  background:#fff;
  border-color:#dbe2ee;
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 5px var(--ring);
  background:#fff;
}

.input-group label {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-weight: 600;
  font-size: 13px;
  color: #9aa4b2;
  transition: all 0.24s ease;
  pointer-events: none;
  background: transparent;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  top: -4px;
  font-size: 12px;
  color: var(--primary);
  padding: 0 8px;
  background-color: #fff;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}

/* ---- Selects with floating labels (aligned to inputs) ---- */
.full-row.three-cols {
  display: flex;
  gap: 4%;
  width: 100%;
}
.full-row.three-cols .third {
  width: 30.66%;
  display: flex;
  flex-direction: column;
}

.select-group { position: relative; }

.select-group select {
  width: 100%;
  padding: 14px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: rgba(255,255,255,.9);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.select-group select:hover { background:#fff; border-color:#dbe2ee; }
.select-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 5px var(--ring); background:#fff; }

.select-group label {
  position: absolute;
  top: 50%;                 /* centered like inputs */
  left: 12px;
  transform: translateY(-50%);
  font-weight: 600;
  font-size: 13px;
  color: #9aa4b2;
  transition: all .24s ease;
  pointer-events: none;
  background: transparent;
}

/* Float to same spot as input labels when focused/filled */
.select-group:focus-within label,
.select-group select:valid ~ label {
  top: -4px;
  font-size: 12px;
  color: var(--primary);
  padding: 0 6px;
  background-color: #fff;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}

/* ---- Password toggle button ---- */
.password-group { position: relative; }
.password-group .show-password {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: rgba(15,23,42,.04);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.password-group .show-password:hover{
  background:#fff; border-color:#cdd6e3;
  box-shadow: 0 6px 14px rgba(15,23,42,.10);
}
.password-group .show-password img { width: 18px; height: 18px; }
.password-group input[type="password"],
.password-group input[type="text"] { padding-right: 48px; }

/* ---- Password hints ---- */
.pw-hints {
  font-size: 11px;
  margin-bottom: 10px;
  text-align: center;
}
.pw-hints ul { list-style: none; margin: 8px 0 0 0; padding: 0; }
.pw-hints li { color: var(--muted); margin: 4px 0; font-weight: 600; }
.pw-hints li.ok { color: #111827; }

/* ---- Buttons ---- */
.button {
  width: 100%;
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-600) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
  transition: transform .08s ease, box-shadow .18s ease, filter .18s ease;
  box-shadow: 0 10px 20px rgba(37,99,235,.25), inset 0 1px 0 rgba(255,255,255,.25);
}
.button:hover { filter: brightness(1.03); box-shadow: 0 16px 28px rgba(37,99,235,.32); transform: translateY(-1px); }
.button:active { transform: translateY(0); box-shadow: 0 10px 20px rgba(37,99,235,.25); }

/* ---- Links / toggles ---- */
.toggle {
  text-align: center;
  margin-top: 12px;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-underline-offset: 3px;
  transition: color .15s ease, opacity .15s ease;
}
.toggle:hover { text-decoration: underline; opacity:.9; }

/* --- Single-card auth pages (forgot/reset/otp) — CENTERED --- */
.auth-shell.single {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px;
}

.auth-shell.single .container {
  max-width: 520px;
  width: 100%;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-shell.single .form-container {
  position: static !important;
  width: 100% !important;
  height: auto;
  transform: none !important;

  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-shell.single .form {
  width: 100% !important;
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 26px;
}
.form.single-card .button { margin-top: 6px; }

@media (max-height: 680px) {
  .auth-shell.single { align-items: flex-start; padding-top: 40px; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px){
  .brand-panel{ max-width: 520px; }
}

@media (max-width: 900px) {
  .auth-shell {
    flex-direction: column;
    gap: 18px;
    padding: 16px;
  }
  .brand-panel, .auth-shell > .container {
    max-width: 720px;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .container {
    max-width: 100%;
    min-height: 580px;
    border-radius: 12px;
  }
  .form { padding: 22px; }
  .brand-panel { padding: 26px 20px; }
  .brand-logo { width: 90px; height: 90px; }
  .brand-title { font-size: 26px; }
}
