/* ============================================================
   AUTH PAGE — auth.css
   ============================================================ */

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

.auth-body {
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
  background: #f7f8fc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.auth-navbar {
  background: #fff;
  border-bottom: 1px solid #e4e5ee;
  position: sticky;
  top: 0;
  z-index: 50;
}
.auth-navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.auth-navbar__back {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted, #888);
  text-decoration: none;
  transition: color .2s;
}
.auth-navbar__back svg { width: 16px; height: 16px; stroke: currentColor; }
.auth-navbar__back:hover { color: #4169e1; }

/* ============================================================
   MAIN GRID
   ============================================================ */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-grid {
  display: grid;
  grid-template-columns: 420px 480px;
  min-height: 580px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.12);
  width: 100%;
  max-width: 900px;
}

/* ============================================================
   LEFT PANEL
   ============================================================ */
.auth-panel {
  background: linear-gradient(160deg, #1a1f6e 0%, #4169e1 55%, #6c8fff 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}
.auth-panel::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  top: -80px; right: -80px;
}
.auth-panel::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  bottom: -60px; left: -60px;
}
.auth-panel__content { position: relative; z-index: 1; }
.auth-panel__logo { font-size: 3rem; margin-bottom: .5rem; }
.auth-panel__title { font-size: 1.6rem; font-weight: 800; margin-bottom: .4rem; }
.auth-panel__sub { font-size: .88rem; opacity: .75; line-height: 1.5; margin-bottom: 2rem; }

.auth-panel__features { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.auth-panel__feat {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.auth-panel__feat-icon { font-size: 1.3rem; flex-shrink: 0; }
.auth-panel__feat strong { display: block; font-size: .88rem; font-weight: 700; margin-bottom: .1rem; }
.auth-panel__feat span  { font-size: .75rem; opacity: .7; }

.auth-panel__stats {
  display: flex;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.2);
}
.auth-panel__stat { text-align: center; }
.auth-panel__stat strong { display: block; font-size: 1.2rem; font-weight: 800; }
.auth-panel__stat span  { font-size: .7rem; opacity: .7; }

/* ============================================================
   RIGHT FORMS PANEL
   ============================================================ */
.auth-forms {
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 2rem 2.25rem;
  overflow-y: auto;
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: #f0f1f7;
  border-radius: 10px;
  padding: .3rem;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}
.auth-tab {
  flex: 1;
  padding: .55rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 700;
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
  color: var(--text-muted, #888);
  cursor: pointer;
  transition: all .2s;
}
.auth-tab.active {
  background: #fff;
  color: #4169e1;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Panels */
.auth-form-panel { display: none; flex: 1; flex-direction: column; }
.auth-form-panel.active { display: flex; flex-direction: column; }

/* Panel slide-in animation */
@keyframes authSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-form-panel.active { animation: authSlideIn .25s ease; }

/* Form head */
.auth-form-head { margin-bottom: 1.25rem; }
.auth-form-head__icon { font-size: 2rem; margin-bottom: .4rem; }
.auth-form-head h1 { font-size: 1.3rem; font-weight: 800; margin-bottom: .25rem; }
.auth-form-head p  { font-size: .83rem; color: var(--text-muted, #888); line-height: 1.5; }


/* Form */
.auth-form { display: flex; flex-direction: column; gap: .75rem; }
.auth-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }

.auth-field { display: flex; flex-direction: column; gap: .25rem; }

.auth-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text, #222);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.auth-req { color: #e63946; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; }

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input-wrap--prefix { border: 1.5px solid #e4e5ee; border-radius: 9px; background: #f7f8fc; overflow: hidden; }
.auth-input-wrap--prefix:focus-within { border-color: #4169e1; box-shadow: 0 0 0 3px rgba(65,105,225,.1); background: #fff; }

.auth-input-icon {
  position: absolute;
  left: .75rem;
  width: 16px;
  height: 16px;
  stroke: #aaa;
  pointer-events: none;
  flex-shrink: 0;
  z-index: 1;
}

.auth-input {
  width: 100%;
  padding: .65rem .75rem .65rem 2.4rem;
  border: 1.5px solid #e4e5ee;
  border-radius: 9px;
  font-size: .88rem;
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
  color: var(--text, #222);
  background: #f7f8fc;
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
}
.auth-input:focus {
  border-color: #4169e1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(65,105,225,.1);
}
.auth-input.error { border-color: #e63946; background: #fff8f8; }
.auth-input.success { border-color: #2ecc71; }

.auth-prefix {
  padding: 0 .65rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted, #888);
  background: #f0f1f7;
  border-right: 1px solid #e4e5ee;
  white-space: nowrap;
  line-height: 42px;
}
.auth-input--prefixed {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-left: .75rem !important;
  flex: 1;
}

/* Eye toggle */
.auth-eye {
  position: absolute;
  right: .65rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  display: flex;
  align-items: center;
  color: #aaa;
  transition: color .15s;
}
.auth-eye:hover { color: #4169e1; }
.auth-eye svg { width: 16px; height: 16px; stroke: currentColor; }

/* Field error */
.auth-field-err {
  font-size: .72rem;
  color: #e63946;
  min-height: .9rem;
  display: block;
  font-weight: 600;
}

/* Password strength */
.auth-strength { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; }
.auth-strength__track { flex: 1; height: 4px; background: #e4e5ee; border-radius: 9999px; overflow: hidden; }
.auth-strength__fill { height: 100%; width: 0; border-radius: 9999px; transition: width .3s, background .3s; }
.auth-strength__label { font-size: .7rem; font-weight: 700; white-space: nowrap; min-width: 48px; }

/* Forgot link */
.auth-forgot-link {
  background: none;
  border: none;
  font-size: .75rem;
  font-weight: 600;
  color: #4169e1;
  cursor: pointer;
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
  transition: color .15s;
  padding: 0;
}
.auth-forgot-link:hover { color: #2a3f8f; text-decoration: underline; }

/* Remember me / terms checkbox row */
.auth-check-row {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .8rem;
  color: var(--text-muted, #888);
  cursor: pointer;
}
.auth-check-row input { accent-color: #4169e1; width: 15px; height: 15px; flex-shrink: 0; margin-top: .1rem; cursor: pointer; }
.auth-link { color: #4169e1; text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }

/* Submit button */
.auth-submit { margin-top: .25rem; font-size: .92rem; }

/* Switch line */
.auth-switch { font-size: .8rem; color: var(--text-muted, #888); text-align: center; margin-top: .75rem; }
.auth-switch-link {
  background: none;
  border: none;
  font-size: .8rem;
  color: #4169e1;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
  transition: color .15s;
}
.auth-switch-link:hover { text-decoration: underline; }

/* ============================================================
   FORGOT PASSWORD
   ============================================================ */
.auth-back-btn {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: none;
  border: none;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted, #888);
  cursor: pointer;
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
  margin-bottom: 1.25rem;
  transition: color .15s;
  padding: 0;
}
.auth-back-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.auth-back-btn:hover { color: #4169e1; }

/* OTP inputs */
.auth-otp-row {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin: 1.25rem 0;
}
.auth-otp-input {
  width: 46px;
  height: 54px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
  border: 2px solid #e4e5ee;
  border-radius: 10px;
  background: #f7f8fc;
  outline: none;
  transition: all .15s;
  color: var(--text, #222);
  caret-color: #4169e1;
}
.auth-otp-input:focus { border-color: #4169e1; background: #fff; box-shadow: 0 0 0 3px rgba(65,105,225,.1); }
.auth-otp-input.filled { border-color: #2ecc71; background: #f0faf4; }
.auth-otp-input.error  { border-color: #e63946; animation: authShake .3s ease; }

.auth-otp-email { color: #4169e1; font-weight: 600; font-size: .82rem; margin-top: .2rem !important; }
.auth-otp-resend { font-size: .78rem; color: var(--text-muted, #888); text-align: center; margin-top: .25rem; }
.auth-otp-timer { color: #e63946; font-weight: 700; }

/* Success state */
.auth-success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .75rem;
  padding: 1.5rem 0;
}
.auth-success-state__icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(46,204,113,.35);
  margin-bottom: .5rem;
}
.auth-success-state h2 { font-size: 1.2rem; font-weight: 800; }
.auth-success-state p  { font-size: .85rem; color: var(--text-muted, #888); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  40%       { transform: translateX(5px); }
  60%       { transform: translateX(-3px); }
  80%       { transform: translateX(3px); }
}

.auth-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin .65s linear infinite;
  vertical-align: middle;
  margin-right: .4rem;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .auth-grid { grid-template-columns: 1fr; max-width: 480px; }
  .auth-panel { display: none; }
  .auth-forms { padding: 1.75rem 1.5rem; border-radius: 20px; }
}
@media (max-width: 520px) {
  .auth-forms { padding: 1.5rem 1.25rem; border-radius: 16px; }
  .auth-form-row { grid-template-columns: 1fr; }
  .auth-otp-input { width: 40px; height: 48px; font-size: 1.2rem; }
  .auth-social { flex-direction: column; }
}
