/* ============================================================
   Auth Page — Modern Dark (modern-login-signup style)
   ============================================================ */

* { box-sizing: border-box; }

/* ── Full-screen dark layout ── */
.auth-body {
  min-height: 100vh;
  background: #000;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
}

/* WebGL canvas background */
#authDotCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Vignette */
.auth-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at center, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

.auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 32px 16px;
  position: relative;
  z-index: 2;
}

/* ── Card ── */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #121212;
  border: 1px solid #272727;
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 10px 50px rgba(0,0,0,0.85);
  animation: slideUp .35s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo ── */
.auth-logo-mark {
  width: 44px; height: 44px;
  background: #111;
  border: 1px solid #333;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.85rem;
  overflow: hidden;
}
.auth-logo-mark img {
  width: 28px; height: 28px; object-fit: contain;
}

/* ── Tabs ── */
.auth-tabs {
  display: flex;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 20px;
  position: relative;
  width: 100%;
}
.auth-tab {
  flex: 1; padding: 8px;
  border: none; background: transparent;
  font-size: 13px; font-weight: 600; color: #666;
  cursor: pointer; border-radius: 7px;
  transition: color .2s; font-family: inherit;
  position: relative; z-index: 1;
}
.auth-tab.active { color: #fff; }
.auth-tab-slider {
  position: absolute; top: 3px; bottom: 3px;
  width: calc(50% - 3px);
  background: #2a2a2a;
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.auth-tab-slider.signup { transform: translateX(calc(100% + 0px)); }

/* ── Alert ── */
.auth-alert {
  padding: 10px 13px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  margin-bottom: 14px; line-height: 1.5;
  width: 100%;
}
.auth-alert.success { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.auth-alert.error   { background: rgba(239,68,68,0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.auth-alert.info    { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.25); }

/* ── Forms ── */
.auth-form { display: none; width: 100%; }
.auth-form.active { display: block; }

.form-header { margin-bottom: 18px; text-align: center; }
.form-header h2 {
  font-size: 1.25rem; font-weight: 700;
  color: #fff; letter-spacing: -0.025em; margin-bottom: 4px;
}
.form-header p { font-size: 0.83rem; color: #888; line-height: 1.5; margin: 0; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-group { margin-bottom: 13px; }
.form-group label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 600; color: #aaa;
  margin-bottom: 6px;
}

/* ── Inputs ── */
.input-wrap {
  position: relative; display: flex; align-items: center;
}
.input-wrap > i {
  position: absolute; left: 11px;
  color: #555; font-size: 13px; pointer-events: none;
}
.input-wrap input {
  width: 100%; padding: 0.65rem 0.85rem 0.65rem 34px;
  border-radius: 7px;
  border: 1px solid #333;
  background: #0a0a0a; color: #fff;
  font-size: 0.875rem; outline: none; font-family: inherit;
  transition: border-color .2s;
}
.input-wrap input::placeholder { color: #555; }
.input-wrap input:focus { border-color: #555; }

.toggle-pw {
  position: absolute; top: 50%; right: 6px;
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  transform: translateY(-50%);
  background: none; border: none; color: #555;
  cursor: pointer; padding: 0; font-size: 13px; z-index: 2;
}
.toggle-pw:hover { color: #aaa; }
.input-wrap:has(> .toggle-pw) input { padding-right: 40px; }

/* ── Password strength ── */
.pw-strength { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.pw-bar { flex: 1; height: 3px; background: #333; border-radius: 2px; overflow: hidden; }
.pw-fill { height: 100%; width: 0; border-radius: 2px; transition: width .3s, background .3s; }
.pw-strength span { font-size: 11px; color: #666; white-space: nowrap; }

/* ── Field error ── */
.field-error { font-size: 11px; color: #f87171; display: block; margin-top: 4px; min-height: 14px; }

/* ── Checkbox ── */
.form-check { margin-bottom: 13px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-label input[type=checkbox] { display: none; }
.checkmark {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid #444; background: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s; flex-shrink: 0;
}
.checkbox-label input:checked ~ .checkmark {
  background: #fff; border-color: #fff;
}
.checkbox-label input:checked ~ .checkmark::after {
  content: ''; display: block;
  width: 9px; height: 5px;
  border-left: 1.5px solid #000; border-bottom: 1.5px solid #000;
  transform: rotate(-45deg) translateY(-1px);
}
.remember-text { font-size: 12.5px; color: #888; }
.agree-text { font-size: 11.5px; color: #888; line-height: 1.45; }
.agree-text a { color: #bbb; text-decoration: underline; text-underline-offset: 2px; }
.agree-text a:hover { color: #fff; }
.signup-terms { margin-top: 2px; }
.signup-terms .field-error { margin-left: 24px; }

/* ── Password label / forgot ── */
.pw-label-text { color: #aaa; }
.forgot-link { font-size: 11px; color: #666; text-decoration: none; }
.forgot-link:hover { color: #aaa; }
.forgot-link-text { font-size: 11px; }

/* ── Buttons ── */
.btn-auth {
  width: 100%; padding: 0.65rem; border-radius: 7px;
  border: none; background: #ededed; color: #000;
  font-weight: 600; font-size: 0.875rem; cursor: pointer;
  font-family: inherit; transition: background .2s, transform .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 4px;
}
.btn-auth:hover { background: #fff; transform: translateY(-1px); }
.btn-auth:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-auth .btn-text { color: #000; }

/* ── Divider ── */
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: #2a2a2a;
}
.auth-divider span { font-size: 11px; color: #555; white-space: nowrap; font-weight: 500; }

/* ── Social Auth ── */
.social-auth { display: flex; gap: 10px; margin-bottom: 4px; }
.social-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px; border: 1px solid #333; border-radius: 8px;
  background: transparent; font-size: 13px; font-weight: 600; color: #fff;
  cursor: pointer; font-family: inherit; transition: border-color .2s, background .2s;
}
.social-btn:hover { border-color: #555; background: #1a1a1a; }
.social-btn i { font-size: 14px; }

/* ── Switch link ── */
.auth-switch { text-align: center; font-size: 12.5px; color: #666; margin-top: 14px; }
.auth-switch a { color: #fff; font-weight: 600; text-decoration: none; }
.auth-switch a:hover { opacity: .7; }

/* ── Back button (forgot) ── */
.back-btn {
  background: none; border: none; color: #888;
  font-size: 13px; cursor: pointer; padding: 0;
  font-family: inherit; display: flex; align-items: center; gap: 6px;
  margin-bottom: 12px;
}
.back-btn:hover { color: #fff; }

/* ── Footer ── */
.auth-footer {
  text-align: center; padding: 14px 16px;
  position: relative; z-index: 2;
}
.auth-footer p { font-size: 12px; color: #444; margin: 0; }

/* ── Google button wrapper ── */
.google-signin-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 340px;
  min-width: 0;
  margin-top: 4px;
  overflow: visible;
}

/* ── Static Google button (shown before GSI renders) ── */
.google-static-btn {
  display: flex; width: 100%; min-width: 0;
  align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 11px 16px; border-radius: 10px;
  border: 1px solid #3b4048; background: linear-gradient(135deg, #24272c, #151619); color: #f6f7f8;
  font-size: 13.5px; font-weight: 650; cursor: pointer;
  font-family: inherit; transition: border-color .2s, background .2s, box-shadow .2s, transform .2s;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.06);
}
.google-static-btn:hover {
  border-color: #67707d;
  background: linear-gradient(135deg, #30343a, #1b1d21);
  box-shadow: 0 10px 22px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.08);
  transform: translateY(-1px);
}
.google-static-btn:focus-visible {
  outline: 2px solid rgba(66,133,244,.7);
  outline-offset: 2px;
}
.google-static-btn:active { transform: translateY(0); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .auth-page {
    align-items: flex-start;
    padding: 20px 12px 16px;
  }
  .auth-card {
    width: 100%;
    padding: 1.25rem;
    border-radius: 10px;
  }
  .auth-logo-mark { margin-bottom: 0.6rem; }
  .auth-tabs { margin-bottom: 16px; }
  .form-header { margin-bottom: 14px; }
  .form-group { margin-bottom: 10px; }
  .form-row { grid-template-columns: 1fr; }
  .social-auth { flex-direction: column; }
  .auth-tab { font-size: 12px; padding: 8px; }
  .input-wrap input { font-size: 16px; }
  .google-signin-wrap { max-width: 100%; }
  .google-static-btn { padding-inline: 10px; }
}
