/* =============================================
   AUTH PAGE — login.html
   All classes prefixed with auth- or .auth-wrap
   to avoid any conflict with existing site styles.
   ============================================= */

.auth-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px 48px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── The card — mobile: single column ── */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(160deg, #1e1040 0%, #160d35 100%);
  border: 1px solid var(--border-mid);
  border-radius: 18px;
  box-shadow: 0 0 80px rgba(124, 58, 237, 0.12), 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* ── Image panel — hidden on mobile ── */
.auth-image-panel {
  display: none;
}

/* ── Form panel ── */
.auth-form-panel {
  padding: 36px 24px 30px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #1e1040 0%, #160d35 100%);
  border-radius: 18px;
}

.auth-form-panel::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 160px;
  background: radial-gradient(ellipse, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Desktop: two-column grid with fixed height so image never resizes ── */
@media (min-width: 860px) {
  .auth-wrap {
    align-items: center;
    padding: 40px 24px 56px;
  }

  .auth-card {
    max-width: 820px;
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 680px;
    overflow: hidden;
    border-radius: 18px;
  }

  .auth-image-panel {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 18px 0 0 18px;
    height: 100%;
  }

  .auth-image-panel img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    display: block;
  }

  .auth-image-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent 55%, #1a0e38 100%);
    pointer-events: none;
  }

  .auth-form-panel {
    padding: 40px 40px 36px;
    border-radius: 0 18px 18px 0;
    background: #1a0e38;
    overflow: hidden;
    height: 100%;
    box-sizing: border-box;
  }
}

/* ── Headings ── */
.auth-title {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.4rem;
  text-align: center;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.auth-sub {
  font-family: var(--font-serif);
  color: var(--text-secondary);
  font-size: 1rem;
  text-align: center;
  margin-bottom: 18px;
  font-style: italic;
}

/* ── Messages ── */
.auth-message {
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  margin-bottom: 12px;
  display: none;
}

.auth-message.error {
  background: rgba(220, 38, 38, 0.25);
  border: 1px solid rgba(220, 38, 38, 0.7);
  color: #ff8080;
  font-weight: 700;
  display: block;
}

.auth-message.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
  display: block;
}

/* ── Tabs ── */
.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px 8px;
  border-radius: var(--r-sm);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.auth-tab.active {
  background: var(--purple-btn);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4);
}

.auth-tab:hover:not(.active) {
  color: var(--gold);
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

/* ── Benefits list ── */
.auth-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-benefits li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.auth-benefits li::before {
  content: '✦';
  color: var(--gold);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ── Form fields ── */
.auth-field-group {
  margin-bottom: 12px;
}

.auth-field-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.auth-field-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.auth-field-input::placeholder {
  color: var(--text-dim);
}

.auth-field-input:focus {
  outline: none;
  border-color: var(--purple-btn);
  box-shadow: 0 0 0 3px rgba(107, 53, 181, 0.15);
}

/* ── Password show/hide ── */
.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .auth-field-input {
  padding-right: 44px;
}

.auth-password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 0;
  line-height: 1;
  font-size: 1rem;
  transition: color 0.2s;
}

.auth-password-toggle:hover {
  color: var(--gold);
}

/* ── Password strength bar ── */
.auth-strength-wrap {
  margin-top: 6px;
  display: none;
}

.auth-strength-wrap.visible {
  display: block;
}

.auth-strength-bar {
  height: 3px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 3px;
}

.auth-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.auth-strength-text {
  font-family: var(--font-ui);
  font-size: 0.72rem;
}

/* ── Forgot password ── */
.auth-forgot-link {
  display: block;
  text-align: right;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--purple-accent);
  text-decoration: none;
  margin-top: -4px;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.auth-forgot-link:hover {
  color: var(--gold);
}

/* ── Buttons ── */
.auth-btn {
  width: 100%;
  border: none;
  border-radius: var(--r-md);
  padding: 13px 16px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}

.auth-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-btn-primary {
  background: linear-gradient(135deg, var(--purple-btn) 0%, #5b21b6 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(107, 53, 181, 0.4);
}

.auth-btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, #a07830 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(214, 162, 74, 0.3);
}

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider-text {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ── Legal copy ── */
.auth-legal {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.6;
  margin-top: 12px;
  margin-bottom: 10px;
}

.auth-legal a {
  color: var(--purple-accent);
  text-decoration: none;
}

.auth-legal a:hover {
  color: var(--gold);
}

/* ── Turnstile — completely hidden, runs silently ── */
.auth-turnstile-wrap {
  margin-top: 8px;
}

/* ── Trust line ── */
.auth-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 12px;
}

.auth-trust i {
  color: var(--gold);
  font-size: 0.85rem;
}

/* ── Mobile tweaks ── */
@media (max-width: 480px) {
  .auth-wrap {
    padding: 20px 12px 40px;
  }

  .auth-form-panel {
    padding: 28px 20px 24px;
  }

  .auth-title {
    font-size: 1.2rem;
  }
}