/* ==========================================================================
   Firetalk Authentic Login Styles — Pixel-Perfect to Reference Screenshots
   ========================================================================== */

body.login-body {
  background-color: #f7f9fb;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
}

/* Header */
.login-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.login-brand img {
  height: 32px;
  width: auto;
}

.login-brand-text {
  font-size: 24px;
  font-weight: 700;
  color: #0284c7;
  letter-spacing: -0.5px;
}

.login-brand-dot {
  color: #38bdf8;
}

/* Main Area */
.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* Login Card */
.login-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #eef2f6;
  width: 100%;
  max-width: 480px;
  padding: 42px 48px;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  transition: all 0.25s ease-in-out;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
}

.title-bar {
  width: 32px;
  height: 3px;
  background-color: #0284c7;
  margin: 0 auto 16px auto;
  border-radius: 2px;
}

.login-subtitle {
  font-size: 13.5px;
  color: #64748b;
  margin: 0 0 28px 0;
  font-weight: 500;
}

/* Method Buttons (Screen 1) */
.methods-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.btn-method {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 20px;
  background: #ffffff;
  border: 1.5px solid #64748b;
  border-radius: 9999px; /* Pill */
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
}

.btn-method:hover {
  background: #f8fafc;
  border-color: #334155;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-method .method-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-method svg {
  width: 18px;
  height: 18px;
}

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1.5px dashed #cbd5e1;
}

.login-divider:not(:empty)::before {
  margin-right: 14px;
}

.login-divider:not(:empty)::after {
  margin-left: 14px;
}

/* Social Buttons */
.social-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
}

.btn-social {
  flex: 1;
  max-width: 110px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #64748b;
  border-radius: 9999px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s ease;
  color: #1e293b;
}

.btn-social:hover {
  background: #f1f5f9;
  border-color: #334155;
}

.btn-social svg {
  width: 18px;
  height: 18px;
}

/* Footer Link */
.login-footer {
  padding-top: 18px;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
  color: #64748b;
}

.login-footer a {
  color: #0284c7;
  font-weight: 600;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Screen 2: Credentials Form
   ========================================================================== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.input-wrap {
  position: relative;
  width: 100%;
}

.login-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  outline: none;
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.forgot-password-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
  margin-bottom: 6px;
}

.forgot-password-link {
  font-size: 12.5px;
  color: #0284c7;
  text-decoration: none;
  font-weight: 500;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

/* Green Submit Pill */
.btn-submit-green {
  width: 100%;
  padding: 13px 20px;
  background-color: #92d659; /* Authentic Paltalk lime green */
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.1s ease;
  box-shadow: 0 2px 6px rgba(146, 214, 89, 0.3);
}

.btn-submit-green:hover {
  background-color: #82c748;
}

.btn-submit-green:active {
  transform: scale(0.99);
}

.btn-submit-green:disabled {
  background-color: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
}

/* Back Button */
.btn-back-method {
  width: 100%;
  padding: 12px 20px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 600;
  color: #0284c7;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-back-method:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Alert Notification */
.login-alert {
  display: none;
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}

.login-alert.error {
  display: block;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.login-alert.success {
  display: block;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* Password Toggle Icon */
.pwd-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0;
}

.pwd-toggle-btn:hover {
  color: #475569;
}

/* API Target Bar & Toggle Pill */
.api-env-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 6px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 11.5px;
}

.api-env-label {
  color: #64748b;
  font-weight: 500;
}

.btn-api-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-api-toggle:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-api-toggle.production {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.btn-api-toggle.local {
  border-color: #fde047;
  background: #fefce8;
  color: #854d0e;
}

.api-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22c55e;
}

.btn-api-toggle.local .api-dot {
  background-color: #eab308;
}

/* Modal styles for Sign Up */
.login-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.login-modal-overlay.open {
  display: flex;
}

.signup-modal-card {
  background: #ffffff;
  border-radius: 12px;
  max-width: 440px;
  width: 100%;
  padding: 32px 36px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  text-align: center;
  position: relative;
  animation: modalFadeIn 0.2s ease;
}

.signup-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.signup-modal-close:hover {
  color: #334155;
}

/* Google reCAPTCHA v3 Notice */
.recaptcha-notice {
  font-size: 11px;
  line-height: 1.4;
  color: #94a3b8;
  margin-top: 8px;
  text-align: center;
}

.recaptcha-notice a {
  color: #64748b;
  text-decoration: underline;
}

.recaptcha-notice a:hover {
  color: #0284c7;
}

/* ==========================================================================
   Mobile Responsiveness for Login
   ========================================================================== */
@media (max-width: 480px) {
  .login-main {
    padding: 16px 12px;
  }

  .login-card {
    padding: 28px 18px;
    border-radius: 8px;
  }

  .login-title {
    font-size: 21px;
  }

  .login-subtitle {
    font-size: 12.5px;
    margin-bottom: 20px;
  }

  .btn-submit-green {
    padding: 12px 16px;
    font-size: 15px;
  }

  .btn-method {
    padding: 11px 14px;
    font-size: 13.5px;
  }

  .signup-modal-card {
    padding: 24px 16px;
    width: 94%;
  }
}

/* ==========================================================================
   UNIVERSAL THEME & DARK MODE ADAPTATIONS (LOGIN.CSS)
   ========================================================================== */
.login-header-actions {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
  font-weight: 600;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.login-divider:not(:empty)::before {
  margin-right: 12px;
}

.login-divider:not(:empty)::after {
  margin-left: 12px;
}

.social-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-social {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary, #0f172a);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-social:hover {
  background: var(--bg-surface-hover, #f1f5f9);
  border-color: var(--border-strong, #cbd5e1);
}

/* Light mode primary button contrast */
.btn-submit-green {
  background: #16a34a !important;
  color: #ffffff !important;
}

.btn-submit-blue {
  background: #0084ff !important;
  color: #ffffff !important;
}

/* Dark mode overrides */
html[data-theme="dark"] body.login-body,
html.dark body.login-body {
  background-color: var(--bg-page);
  color: var(--text-primary);
}

html[data-theme="dark"] .login-header,
html.dark .login-header {
  background: var(--bg-surface);
  border-bottom-color: var(--border-subtle);
}

html[data-theme="dark"] .login-card,
html.dark .login-card {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .login-title,
html.dark .login-title {
  color: var(--text-primary);
}

html[data-theme="dark"] .login-subtitle,
html.dark .login-subtitle {
  color: var(--text-muted);
}

html[data-theme="dark"] .form-input,
html.dark .form-input {
  background: var(--bg-input);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

html[data-theme="dark"] .form-input:focus,
html.dark .form-input:focus {
  border-color: var(--border-active);
}

html[data-theme="dark"] .form-label,
html.dark .form-label {
  color: var(--text-secondary);
}

html[data-theme="dark"] .btn-method,
html.dark .btn-method {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

html[data-theme="dark"] .btn-method:hover,
html.dark .btn-method:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .signup-modal-card,
html.dark .signup-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  color: var(--text-primary);
}

html[data-theme="dark"] .api-env-bar,
html.dark .api-env-bar {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .btn-api-toggle,
html.dark .btn-api-toggle {
  background: var(--bg-input);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

/* ==========================================================================
   Multi-Step Signup & Paltalk-Inspired Authentic Components
   ========================================================================== */

.auth-nav-tabs {
  display: flex;
  background: var(--bg-surface-elevated, #f1f5f9);
  border-radius: 9999px;
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--border-subtle, #e2e8f0);
}

.auth-nav-tab {
  flex: 1;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.auth-nav-tab.active {
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary, #0f172a);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .auth-nav-tabs,
html.dark .auth-nav-tabs {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .auth-nav-tab.active,
html.dark .auth-nav-tab.active {
  background: #1e293b;
  color: #f8fafc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.step-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.step-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
}

.step-back-btn {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.step-back-btn:hover {
  color: #0284c7;
}

/* 6-Digit Code Input */
.code-entry-wrap {
  margin: 20px 0;
  text-align: center;
}

.code-digit-input {
  width: 100%;
  max-width: 260px;
  height: 56px;
  padding: 0 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 12px;
  text-align: center;
  border: 2px solid var(--border-subtle, #cbd5e1);
  border-radius: 12px;
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary, #0f172a);
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.code-digit-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

.code-resend-row {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0284c7;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:disabled {
  color: var(--text-muted, #94a3b8);
  cursor: not-allowed;
  text-decoration: none;
}

/* Nickname Availability Checker & Suggestions */
.nickname-field-wrap {
  position: relative;
}

.nickname-status-indicator {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.nickname-feedback-box {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: left;
  display: none;
}

.nickname-feedback-box.available {
  display: block;
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.nickname-feedback-box.taken {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.suggestions-wrap {
  margin-top: 14px;
  text-align: left;
  display: none;
}

.suggestions-wrap.visible {
  display: block;
}

.suggestions-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  margin-bottom: 8px;
}

.suggestions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--bg-surface-elevated, #f1f5f9);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.25);
  cursor: pointer;
  transition: all 0.15s ease;
}

.suggestion-chip:hover {
  background: #0284c7;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.25);
}

.suggestion-chip .plus-icon {
  font-size: 10px;
  opacity: 0.7;
}

/* Spinner */
.ft-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(2, 132, 199, 0.25);
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: ftSpin 0.7s linear infinite;
}

@keyframes ftSpin {
  to { transform: rotate(360deg); }
}

