/* ==========================================================
   StreamForge — Auth Pages (Login & Register)
   ========================================================== */

/* ---- Layout ---- */
.sf-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 2rem 1rem;
  background: var(--color-bg);
}

/* ---- Animated background ---- */
.sf-auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.sf-auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 245, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: sf-grid-drift 25s linear infinite;
}

@keyframes sf-grid-drift {
  0%   { transform: translateY(0); }
  100% { transform: translateY(48px); }
}

.sf-auth-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}

.sf-auth-glow--1 {
  width: 600px;
  height: 600px;
  top: -150px;
  right: -100px;
  background: var(--color-accent);
  animation: sf-glow-pulse 6s ease-in-out infinite;
}

.sf-auth-glow--2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -80px;
  background: var(--color-neon);
  animation: sf-glow-pulse 8s ease-in-out infinite reverse;
}

@keyframes sf-glow-pulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50%       { opacity: 0.30; transform: scale(1.08); }
}

/* ---- Card ---- */
.sf-auth-card-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.sf-auth-card {
  width: 100%;
  background: rgba(13, 13, 31, 0.85);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(0, 245, 255, 0.06),
    0 32px 64px rgba(0, 0, 0, 0.5);
  animation: sf-card-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes sf-card-in {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Branding ---- */
.sf-auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.sf-auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.sf-auth-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-neon), var(--color-accent));
  border-radius: 6px;
  font-size: 1.1rem;
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

.sf-auth-tagline {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0.25rem 0 0;
}

/* ---- Alerts ---- */
.sf-auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  border: 1px solid;
  line-height: 1.5;
}

.sf-alert-icon {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 1px;
}

.sf-auth-alert--error {
  background: rgba(255, 60, 110, 0.1);
  border-color: rgba(255, 60, 110, 0.35);
  color: #ff8aa8;
}

.sf-auth-alert--error .sf-alert-icon { color: var(--color-hot); }

.sf-auth-alert--success {
  background: rgba(0, 245, 150, 0.08);
  border-color: rgba(0, 245, 150, 0.3);
  color: #5effc8;
}

.sf-auth-alert--success .sf-alert-icon { color: #5effc8; }

.sf-auth-alert--info {
  background: rgba(0, 245, 255, 0.06);
  border-color: rgba(0, 245, 255, 0.25);
  color: var(--color-muted);
}

.sf-auth-alert--info .sf-alert-icon { color: var(--color-neon); }

/* ---- Form Fields ---- */
.sf-auth-form { display: flex; flex-direction: column; gap: 1.1rem; }

.sf-field { display: flex; flex-direction: column; gap: 0.4rem; }

.sf-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.sf-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sf-forgot-link {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--color-neon);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.sf-forgot-link:hover { opacity: 1; color: var(--color-neon); }

/* ---- Input ---- */
.sf-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sf-input-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.15s;
}

.sf-input {
  width: 100%;
  background: rgba(6, 6, 16, 0.7);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem 2.75rem 0.75rem 2.6rem;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

.sf-input::placeholder { color: rgba(107, 107, 154, 0.5); }

.sf-input:focus {
  border-color: var(--color-neon);
  box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.1);
}

.sf-input:focus + .sf-input-icon,
.sf-input-wrap:focus-within .sf-input-icon {
  color: var(--color-neon);
}

/* No left icon on captcha input */
.sf-captcha-input {
  padding-left: 0.9rem;
  max-width: 120px;
}

/* ---- Password toggle ---- */
.sf-toggle-pw {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.15s;
}

.sf-toggle-pw:hover { color: var(--color-neon); }

/* ---- Password strength meter ---- */
.sf-pw-meter {
  display: none;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.sf-pw-meter.is-active { display: flex; }

.sf-pw-meter-bar {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

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

.sf-pw-meter-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  white-space: nowrap;
  color: var(--color-muted);
  min-width: 70px;
}

/* Strength levels */
.sf-pw-meter[data-strength="1"] .sf-pw-meter-fill { width: 20%; background: #ff3c6e; }
.sf-pw-meter[data-strength="1"] .sf-pw-meter-label { color: #ff3c6e; }
.sf-pw-meter[data-strength="2"] .sf-pw-meter-fill { width: 40%; background: #ff8c00; }
.sf-pw-meter[data-strength="2"] .sf-pw-meter-label { color: #ff8c00; }
.sf-pw-meter[data-strength="3"] .sf-pw-meter-fill { width: 65%; background: #ffd700; }
.sf-pw-meter[data-strength="3"] .sf-pw-meter-label { color: #ffd700; }
.sf-pw-meter[data-strength="4"] .sf-pw-meter-fill { width: 82%; background: #7fff00; }
.sf-pw-meter[data-strength="4"] .sf-pw-meter-label { color: #7fff00; }
.sf-pw-meter[data-strength="5"] .sf-pw-meter-fill { width: 100%; background: var(--color-neon); }
.sf-pw-meter[data-strength="5"] .sf-pw-meter-label { color: var(--color-neon); }

/* ---- Password rules checklist ---- */
.sf-pw-rules {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 1rem;
}

.sf-pw-rules.is-active { display: grid; }

.sf-pw-rule {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-muted);
  padding-left: 1.1rem;
  position: relative;
  transition: color 0.2s;
}

.sf-pw-rule::before {
  content: '○';
  position: absolute;
  left: 0;
  font-size: 0.55rem;
}

.sf-pw-rule.is-met {
  color: var(--color-neon);
}

.sf-pw-rule.is-met::before { content: '●'; }

/* ---- Password match message ---- */
.sf-pw-match-msg {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  margin: 0.2rem 0 0;
  min-height: 1em;
}

.sf-pw-match-msg.is-match { color: var(--color-neon); }
.sf-pw-match-msg.is-mismatch { color: var(--color-hot); }

/* ---- CAPTCHA ---- */
.sf-captcha-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sf-captcha-question {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 245, 255, 0.04);
  border: 1px solid rgba(0, 245, 255, 0.15);
  border-radius: 8px;
  padding: 0.7rem 1rem;
}

.sf-captcha-icon { font-size: 1rem; }

.sf-captcha-text {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-neon);
  letter-spacing: 0.08em;
}

/* ---- Checkbox ---- */
.sf-field--check { margin-top: 0.25rem; }

.sf-check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--color-muted);
  cursor: pointer;
  user-select: none;
}

.sf-check-label a {
  color: var(--color-neon);
  text-decoration: none;
}

.sf-check-label a:hover { text-decoration: underline; }

.sf-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.sf-checkmark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: rgba(6, 6, 16, 0.7);
  transition: all 0.15s;
  position: relative;
  margin-top: 1px;
}

.sf-checkbox:checked ~ .sf-checkmark {
  background: var(--color-neon);
  border-color: var(--color-neon);
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.4);
}

.sf-checkbox:checked ~ .sf-checkmark::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: 2px solid var(--color-bg);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.sf-checkbox:focus-visible ~ .sf-checkmark {
  outline: 2px solid var(--color-neon);
  outline-offset: 2px;
}

/* ---- Submit button ---- */
.sf-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.9rem 1.5rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--color-neon), var(--color-accent));
  color: var(--color-bg);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.2);
}

.sf-auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 245, 255, 0.3);
}

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

.sf-auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.sf-auth-btn-icon {
  font-size: 1.1rem;
  transition: transform 0.15s;
}

.sf-auth-btn:hover .sf-auth-btn-icon { transform: translateX(3px); }

/* ---- Switch link ---- */
.sf-auth-switch {
  text-align: center;
  margin: 1.5rem 0 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.sf-auth-switch a {
  color: var(--color-neon);
  text-decoration: none;
  font-weight: 600;
}

.sf-auth-switch a:hover { text-decoration: underline; }

/* ---- Back link ---- */
.sf-auth-home-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-muted);
  letter-spacing: 0.1em;
}

.sf-auth-home-link a {
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.sf-auth-home-link a:hover { color: var(--color-neon); }

/* ---- Responsive ---- */
@media (max-width: 520px) {
  .sf-auth-card { padding: 1.75rem 1.25rem; }
  .sf-captcha-row { flex-direction: column; align-items: stretch; }
  .sf-captcha-input { max-width: 100%; }
  .sf-pw-rules { grid-template-columns: 1fr; }
}
