/* ================================================================
   WhiteCoder World News — auth.css
   Login · Register · Profile · Password Reset pages
   Split-screen editorial design: news panel + form panel
   ================================================================ */

/* ── Auth Page Layout ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 0;           /* auth pages override site-wrapper margin */
}

/* ── Left Panel — Editorial News Visual ─────────────────────────── */
.auth-visual {
  position: relative;
  background: var(--text-primary);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  min-height: 100vh;
}

.auth-visual-bg {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(255,255,255,0.03) 39px,
      rgba(255,255,255,0.03) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(255,255,255,0.03) 39px,
      rgba(255,255,255,0.03) 40px
    );
  pointer-events: none;
}

.auth-visual-accent {
  position: absolute;
  top: -120px;
  right: -120px;
  width: 400px;
  height: 400px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.12;
  pointer-events: none;
}

.auth-visual-accent-2 {
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 280px;
  height: 280px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.08;
  pointer-events: none;
}

.auth-visual-top {
  position: relative;
  z-index: 1;
}

.auth-visual-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.auth-visual-logo-mark {
  width: 38px; height: 38px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
}
.auth-visual-logo-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.auth-visual-logo-text small {
  display: block;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.auth-visual-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
}

.auth-visual-headline {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.5vw, 52px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 20px;
}
.auth-visual-headline .accent-word {
  color: var(--accent);
  display: block;
}

.auth-visual-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  line-height: 1.65;
  max-width: 340px;
  margin-bottom: 36px;
}

.auth-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}
.auth-feature-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.auth-visual-bottom {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.04em;
}

/* Floating news card decorations */
.auth-deco-card {
  position: absolute;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  padding: 14px 16px;
  z-index: 1;
  pointer-events: none;
}
.auth-deco-card-1 {
  right: 24px;
  top: 30%;
  width: 200px;
  animation: float1 6s ease-in-out infinite;
}
.auth-deco-card-2 {
  right: 56px;
  top: 52%;
  width: 170px;
  animation: float2 7s ease-in-out infinite 1s;
}
.auth-deco-card-dot {
  width: 24px; height: 5px;
  background: var(--accent);
  border-radius: 3px;
  margin-bottom: 8px;
}
.auth-deco-card-line {
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  margin-bottom: 6px;
}
.auth-deco-card-line:last-child { width: 65%; }

@keyframes float1 {
  0%, 100% { transform: translateY(0px) rotate(-1deg); }
  50%       { transform: translateY(-12px) rotate(1deg); }
}
@keyframes float2 {
  0%, 100% { transform: translateY(0px) rotate(1deg); }
  50%       { transform: translateY(-8px) rotate(-1deg); }
}

/* ── Right Panel — Auth Form ─────────────────────────────────────── */
.auth-form-panel {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
  overflow-y: auto;
  min-height: 100vh;
}

/* Back to site link top-right */
.auth-back-link {
  position: absolute;
  top: 28px; right: 28px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition);
}
.auth-back-link:hover { color: var(--accent); }

.auth-form-inner {
  width: 100%;
  max-width: 400px;
}

.auth-form-header { margin-bottom: 36px; }

.auth-form-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 12px;
}

.auth-form-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.15;
}

.auth-form-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}
.auth-form-sub a {
  color: var(--accent);
  font-weight: 600;
}
.auth-form-sub a:hover { text-decoration: underline; }

/* ── Auth Form Fields ────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }

.auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.auth-input-wrap {
  position: relative;
}
.auth-input-wrap .field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.auth-field input:not([type="checkbox"]) {
  width: 100%;
  padding: 12px 14px 12px 40px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
}
.auth-field input:not([type="checkbox"]):focus {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.auth-field input:not([type="checkbox"]):focus + .field-icon,
.auth-input-wrap:focus-within .field-icon {
  color: var(--accent);
}
.auth-field input:not([type="checkbox"])::placeholder { color: var(--text-muted); }

/* Checkbox — explicit small size, never stretched */
.auth-field input[type="checkbox"] {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px;
  padding: 0 !important;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  -webkit-appearance: checkbox;
  appearance: checkbox;
}

/* Password toggle eye button */
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
  display: flex; align-items: center;
}
.pw-toggle:hover { color: var(--text-primary); }

/* Field hint text */
.field-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.field-error {
  font-size: 11.5px;
  color: #DC2626;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Password strength bar */
.pw-strength-wrap {
  margin-top: 6px;
}
.pw-strength-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 4px;
}
.pw-strength-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease, background 0.3s ease;
}
.pw-strength-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Form Options Row ────────────────────────────────────────────── */
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  line-height: 1.5;
}
.auth-checkbox input[type="checkbox"] {
  margin-top: 1px; /* align with first line of text */
}
.auth-checkbox span {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}
/* Links inside checkbox label open in new tab — stop click propagating to label */
.auth-checkbox span a {
  position: relative;
  z-index: 2;
  pointer-events: all;
}

.auth-forgot {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  transition: opacity var(--transition);
}
.auth-forgot:hover { opacity: 0.75; }

/* ── Submit Button ───────────────────────────────────────────────── */
.btn-auth-submit {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-body);
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.btn-auth-submit:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-auth-submit:active { transform: translateY(0); }
.btn-auth-submit.loading { pointer-events: none; opacity: 0.8; }

/* Ripple on submit */
.btn-auth-submit::after {
  content: '';
  position: absolute;
  width: 0; height: 0;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}
.btn-auth-submit:active::after {
  width: 300px; height: 300px; opacity: 0;
}

/* ── Divider ─────────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 4px 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Alert Messages ──────────────────────────────────────────────── */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 4px;
  line-height: 1.5;
}
.auth-alert-error {
  background: rgba(220,38,38,0.08);
  border: 1px solid rgba(220,38,38,0.25);
  color: #DC2626;
}
.auth-alert-success {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.25);
  color: #059669;
}
.auth-alert svg { flex-shrink: 0; margin-top: 1px; }

/* ── Profile Page ────────────────────────────────────────────────── */
.profile-page { padding: 40px 0 80px; }

.profile-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}
.profile-avatar-wrap { position: relative; }
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.profile-info .profile-email { font-size: 14px; color: var(--text-muted); margin-bottom: 10px; }
.profile-role-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 3px;
}
.role-reader   { background: rgba(99,102,241,0.12); color: #6366f1; }
.role-premium  { background: rgba(218,165,32,0.15); color: #B8860B; }
.role-editor   { background: rgba(16,185,129,0.12); color: #059669; }
.role-admin    { background: rgba(230,57,70,0.12);  color: var(--accent); }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.profile-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}
.profile-stat-card .stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.profile-stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form-panel {
    padding: 80px 28px 48px;
    min-height: auto;
    justify-content: flex-start;
  }
  .auth-form-panel::before {
    content: 'W';
    position: absolute;
    top: 24px; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 40px;
    background: var(--accent);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 18px;
    text-align: center;
    line-height: 40px;
  }
}
@media (max-width: 480px) {
  .auth-form-panel { padding: 80px 20px 40px; }
  .profile-header  { flex-direction: column; text-align: center; }
  .profile-stats   { grid-template-columns: 1fr; }
}
