/* ==========================================================================
   QUIETMETRIC // AUTHENTICATION STYLES (Sign In & Sign Up)
   Matches the split-screen design reference:
   - Left: Dark burgundy/charcoal panel with QuietMetric branding & value checklist
   - Right: Clean light neutral backdrop with floating white auth card
   ========================================================================== */

:root {
  --auth-bg-dark: #141113;
  --auth-bg-dark-accent: #1f171b;
  --auth-bg-light: #f5f6f8;
  --auth-card-bg: #ffffff;
  --auth-text-dark: #0f172a;
  --auth-text-muted: #64748b;
  --auth-text-subtle: #94a3b8;
  --auth-border-light: #e2e8f0;
  --auth-border-input: #e2e8f0;
  --auth-coral: #eb5e28;
  --auth-coral-hover: #d84e1b;
  --auth-coral-focus: rgba(235, 94, 40, 0.18);
  --auth-pink-border: #f43f5e;
  --auth-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --auth-font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--auth-font-sans);
  background-color: var(--auth-bg-light);
  color: var(--auth-text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main Split-Screen Container */
.auth-split-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* ==========================================================================
   LEFT HERO PANEL (Dark Branding & Checklist)
   ========================================================================== */
.auth-brand-pane {
  flex: 0 0 50%;
  max-width: 50%;
  background: radial-gradient(circle at 18% 38%, rgba(235, 94, 40, 0.10) 0%, transparent 55%),
              linear-gradient(175deg, #181316 0%, #120f11 50%, #0d0a0c 100%);
  color: #ffffff;
  padding: 60px 70px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Ambient glow accent */
.auth-brand-pane::before {
  content: "";
  position: absolute;
  top: -120px;
  left: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(235, 94, 40, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand-pane::after {
  content: "";
  position: absolute;
  bottom: -100px;
  right: -60px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand-top {
  position: relative;
  z-index: 2;
}

.auth-brand-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.auth-brand-logo-link:hover {
  opacity: 0.9;
}

.auth-brand-logo-img {
  height: 44px;
  width: auto;
  display: block;
}

/* Middle Content: Title, Description, Checklist */
.auth-brand-content {
  position: relative;
  z-index: 2;
  margin: auto 0;
  padding: 40px 0;
  max-width: 580px;
}

.auth-brand-title {
  font-size: 2.25rem;
  line-height: 1.22;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}

.auth-brand-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 36px;
  font-weight: 400;
}

/* Feature Checklist */
.auth-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.975rem;
  color: #e2e8f0;
  line-height: 1.45;
}

.auth-check-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #f43f5e;
  margin-top: 2px;
}

.auth-check-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 3;
  stroke: currentColor;
  fill: none;
}

/* Bottom footer of left pane */
.auth-brand-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
}

.auth-brand-footer a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-brand-footer a:hover {
  color: #ffffff;
}

/* ==========================================================================
   RIGHT AUTH FORM PANE (Light Background with Centered Card)
   ========================================================================== */
.auth-form-pane {
  flex: 0 0 50%;
  max-width: 50%;
  background-color: var(--auth-bg-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
  min-height: 100vh;
  position: relative;
}

/* Clean Floating Card */
.auth-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--auth-card-bg);
  border-radius: 18px;
  padding: 40px 36px;
  box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.08),
              0 2px 8px -2px rgba(15, 23, 42, 0.04);
  border: 1px solid var(--auth-border-light);
  position: relative;
  transition: transform 0.25s ease;
}

.auth-card-header {
  margin-bottom: 28px;
}

.auth-card-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--auth-text-dark);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.auth-card-subtitle {
  font-size: 0.925rem;
  color: var(--auth-text-muted);
  line-height: 1.45;
}

/* Form Groups & Inputs */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.auth-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--auth-text-muted);
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--auth-text-dark);
  background-color: #ffffff;
  border: 1.5px solid var(--auth-border-input);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

/* Focus state with subtle red/coral border highlight matching reference */
.auth-input:focus,
.auth-input.is-active {
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
}

.auth-input.has-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Password Toggle Icon Button */
.auth-pwd-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.auth-pwd-toggle:hover {
  color: var(--auth-text-dark);
}

.auth-pwd-toggle svg {
  width: 18px;
  height: 18px;
}

/* Extra row for Remember Me / Forgot Password */
.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  margin-top: -6px;
}

.auth-remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--auth-text-muted);
  user-select: none;
}

.auth-remember-label input[type="checkbox"] {
  accent-color: var(--auth-coral);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.auth-forgot-link {
  color: var(--auth-coral);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

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

/* Primary Action Button (Sign in / Sign up) */
.auth-submit-btn {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #f43f5e 0%, #eb5e28 100%);
  color: #ffffff;
  font-size: 0.975rem;
  font-weight: 600;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 6px 18px -4px rgba(244, 63, 94, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -4px rgba(244, 63, 94, 0.5);
  opacity: 0.97;
}

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

.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: authSpin 0.75s linear infinite;
  display: none;
}

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

/* Divider with 'OR' */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--auth-text-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--auth-border-light);
}

.auth-divider span {
  padding: 0 14px;
}

/* Social Google Button */
.auth-google-btn {
  width: 100%;
  height: 48px;
  background-color: #ffffff;
  color: var(--auth-text-dark);
  border: 1.5px solid var(--auth-border-input);
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-google-btn:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.auth-google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Bottom Toggle Text (Don't have an account? Create one) */
.auth-toggle-footer {
  text-align: center;
  margin-top: 26px;
  font-size: 0.9rem;
  color: var(--auth-text-muted);
}

.auth-toggle-link {
  color: #f43f5e;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
  margin-left: 4px;
}

.auth-toggle-link:hover {
  text-decoration: underline;
  color: #e11d48;
}

/* Demo One-Click Access Box */
.auth-demo-badge {
  margin-top: 22px;
  padding: 12px 14px;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--auth-text-muted);
}

.auth-demo-badge-text strong {
  color: var(--auth-text-dark);
}

.auth-demo-btn {
  background-color: #0f172a;
  color: #ffffff;
  border: none;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.auth-demo-btn:hover {
  background-color: #1e293b;
}

/* Dynamic Alert/Toast Banner */
.auth-alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: none;
  line-height: 1.4;
}

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

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

.auth-alert.info {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  display: block;
}

/* Return to Website link top-right of light pane */
.auth-back-link {
  position: absolute;
  top: 24px;
  right: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--auth-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 7px;
  background-color: #ffffff;
  border: 1px solid var(--auth-border-light);
  transition: all 0.15s ease;
}

.auth-back-link:hover {
  color: var(--auth-text-dark);
  border-color: #cbd5e1;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tablets & Mobile)
   ========================================================================== */
@media (max-width: 1024px) {
  .auth-brand-pane {
    flex: 0 0 45%;
    max-width: 45%;
    padding: 40px;
  }
  .auth-form-pane {
    flex: 0 0 55%;
    max-width: 55%;
    padding: 30px 20px;
  }
  .auth-brand-title {
    font-size: 1.85rem;
  }
}

@media (max-width: 860px) {
  .auth-split-wrapper {
    flex-direction: column;
  }
  .auth-brand-pane {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    padding: 40px 24px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .auth-brand-content {
    padding: 24px 0;
  }
  .auth-brand-title {
    font-size: 1.6rem;
  }
  .auth-form-pane {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    padding: 40px 20px 60px;
  }
  .auth-back-link {
    position: static;
    margin-bottom: 20px;
    align-self: flex-start;
  }
}
