/* ============================================================
   Auth pages — dark neumorphism
   Font loaded via <link> in each page's <head>
   ============================================================ */

/* ── Base reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── CSS custom properties ──────────────────────────────────── */
:root {
  --brand:          #0f3460;
  --brand-glow:     rgba(15, 52, 96, 0.35);
  --brand-gradient: linear-gradient(135deg, #0d1117 0%, rgba(15,52,96,0.9) 100%);
}

/* ── Page shell ─────────────────────────────────────────────── */
body.auth-page {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', sans-serif;
  background: #0e0e0d;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-y: auto;   /* was hidden — allow scrolling on short viewports */
}

/* Ambient brand glow at top */
body.auth-page::before {
  content: '';
  position: fixed;
  top: -25%;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  height: 65vh;
  background: radial-gradient(ellipse at center, var(--brand-glow) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

/* ── Card ───────────────────────────────────────────────────── */
.auth-container {
  position: relative;
  z-index: 1;
  background: rgb(34, 34, 33);
  border-radius: 22px;
  box-shadow:
    14px 14px 28px rgb(10, 10, 9),
    -7px -7px 18px rgb(44, 44, 42),
    0 0 0 1px rgba(255, 255, 255, 0.043);
  width: 100%;
  max-width: 420px;
  /* No overflow:hidden — let body control scroll; clipping cut off content on mobile */
  animation: authSlideUp 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes authSlideUp {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Card header (brand gradient band) ─────────────────────── */
.auth-header {
  background: var(--brand-gradient);
  padding: 36px 30px;
  text-align: center;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-header-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.auth-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.auth-icon-wrap i {
  font-size: 22px;
  color: #fff;
}

.auth-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.auth-header p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

/* ── Card body (dark surface) ───────────────────────────────── */
.auth-body {
  background: rgb(34, 34, 33);
  padding: 36px 30px;
}

/* ── Subtitle ───────────────────────────────────────────────── */
.auth-subtitle {
  margin-bottom: 24px;
}

.auth-subtitle h2 {
  font-size: 18px;
  font-weight: 700;
  color: #e8e8e6;
  margin-bottom: 4px;
}

.auth-subtitle p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

/* ── Alert messages ─────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 20px;
}

.alert i { flex-shrink: 0; margin-top: 2px; }

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border-left: 4px solid #ef4444;
  color: #fca5a5;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border-left: 4px solid #22c55e;
  color: #86efac;
}

.alert a { color: inherit; text-decoration: underline; opacity: 0.85; }

/* ── Form groups ────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 7px;
  letter-spacing: 0.1px;
}

.form-group .required {
  color: #ef4444;
  vertical-align: middle;
  line-height: 1;
  margin-left: 2px;
}

.input-wrapper {
  position: relative;
}

/* ── Inputs ─────────────────────────────────────────────────── */
.form-control-auth {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #e8e8e6;
  background: rgb(27, 27, 26);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  outline: none;
  box-shadow: inset 4px 4px 8px rgb(10, 10, 9), inset -2px -2px 5px rgb(42, 42, 40);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-control-auth::placeholder {
  color: rgba(255, 255, 255, 0.28);
  font-size: 13px;
}

.form-control-auth:focus {
  border-color: var(--brand);
  box-shadow:
    inset 4px 4px 8px rgb(10, 10, 9),
    inset -2px -2px 5px rgb(42, 42, 40),
    0 0 0 3px var(--brand-glow);
}

/* ── Password eye toggle ────────────────────────────────────── */
.password-toggle {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: color 0.18s;
  z-index: 2;
  user-select: none;
}
.password-toggle:hover { color: rgba(255, 255, 255, 0.65); }

/* ── Forgot password row ────────────────────────────────────── */
.forgot-row {
  text-align: right;
  margin-top: -8px;
  margin-bottom: 22px;
}

.forgot-row a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.18s;
}
.forgot-row a:hover { color: var(--brand); }

/* ── Submit button ──────────────────────────────────────────── */
.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.15px;
  color: #ffffff;
  background: var(--brand-gradient);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 4px 18px var(--brand-glow);
  transition: opacity 0.18s ease, transform 0.14s ease, box-shadow 0.18s ease;
}

.btn-auth:hover  {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--brand-glow);
}
.btn-auth:active { opacity: 1; transform: translateY(0); }

/* ── Footer link ────────────────────────────────────────────── */
.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

.auth-link a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  filter: brightness(1.6);
}
.auth-link a:hover { opacity: 0.8; }

/* ── Divider ────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: rgba(255,255,255,0.2);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

/* ── Browser autofill override (prevents white bg on some inputs) ─── */
.form-control-auth:-webkit-autofill,
.form-control-auth:-webkit-autofill:hover,
.form-control-auth:-webkit-autofill:focus,
.form-control-auth:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px rgb(27, 27, 26) inset,
                      inset 4px 4px 8px rgb(10, 10, 9),
                      inset -2px -2px 5px rgb(42, 42, 40) !important;
  box-shadow: 0 0 0 1000px rgb(27, 27, 26) inset,
              inset 4px 4px 8px rgb(10, 10, 9),
              inset -2px -2px 5px rgb(42, 42, 40) !important;
  -webkit-text-fill-color: #e8e8e6 !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  transition: background-color 9999s ease-in-out 0s;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  body.auth-page {
    align-items: flex-start;   /* card starts at top — scrollable instead of centred */
    padding: 16px 12px 32px;
  }
  .auth-container {
    border-radius: 16px;
    margin: auto;  /* still horizontally centered */
  }
  .auth-header { padding: 24px 18px; }
  .auth-body   { padding: 20px 18px; }
}
