/* ============================================================
   iSecure Society — Auth Pages Stylesheet
   Premium split-panel auth with security indicators
   ============================================================ */

/* Auth page wrapper — split layout */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
}

/* === LEFT PANEL — Security Branding === */
.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-12);
  background: linear-gradient(160deg, #030b1a 0%, #0a1628 40%, #0c1e3a 70%, #061225 100%);
  overflow: hidden;
}

.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 600px at 30% 20%, rgba(6, 182, 212, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 70% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Animated grid lines */
.auth-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 70%);
  pointer-events: none;
}

.auth-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 420px;
}

.auth-hero-shield {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--space-8);
  position: relative;
  animation: float 6s ease-in-out infinite;
}

.auth-hero-shield svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 30px rgba(6, 182, 212, 0.3));
}

.auth-hero h2 {
  font-size: var(--text-3xl);
  font-weight: 800;
  background: linear-gradient(135deg, #e0fcff 0%, #22d3ee 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-4);
  line-height: var(--leading-tight);
}

.auth-hero p {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-10);
}

/* Security features list */
.security-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
  width: 100%;
}

.security-feature {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: rgba(6, 182, 212, 0.04);
  border: 1px solid rgba(6, 182, 212, 0.08);
  border-radius: var(--radius-lg);
  transition: all var(--duration-normal) var(--ease-out);
}

.security-feature:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.15);
  transform: translateX(4px);
}

.security-feature-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-md);
  background: rgba(6, 182, 212, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.security-feature-icon svg {
  width: 20px;
  height: 20px;
  color: var(--primary-400);
}

.security-feature span {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

/* Floating particles on hero */
.auth-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.auth-particles span {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--primary-400);
  border-radius: 50%;
  opacity: 0.25;
  animation: float 8s ease-in-out infinite;
}
.auth-particles span:nth-child(1)  { top: 10%; left: 20%; animation-delay: 0s; animation-duration: 12s; }
.auth-particles span:nth-child(2)  { top: 30%; left: 70%; animation-delay: 2s; animation-duration: 10s; width: 3px; height: 3px; }
.auth-particles span:nth-child(3)  { top: 60%; left: 40%; animation-delay: 4s; animation-duration: 14s; }
.auth-particles span:nth-child(4)  { top: 80%; left: 80%; animation-delay: 1s; animation-duration: 11s; width: 3px; height: 3px; }
.auth-particles span:nth-child(5)  { top: 50%; left: 10%; animation-delay: 3s; animation-duration: 13s; }
.auth-particles span:nth-child(6)  { top: 20%; left: 90%; animation-delay: 5s; animation-duration: 9s; }
.auth-particles span:nth-child(7)  { top: 70%; left: 25%; animation-delay: 2s; animation-duration: 11s; width: 4px; height: 4px; opacity: 0.15; }
.auth-particles span:nth-child(8)  { top: 15%; left: 55%; animation-delay: 6s; animation-duration: 15s; }
.auth-particles span:nth-child(9)  { top: 85%; left: 60%; animation-delay: 3s; animation-duration: 10s; width: 3px; height: 3px; }

/* === RIGHT PANEL — Form === */
.auth-form-panel {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-12) var(--space-8);
  background: var(--bg-primary);
  position: relative;
  overflow-y: auto;
  max-height: 100vh;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: var(--space-8) var(--space-6);
  background: rgba(10, 22, 40, 0.6);
  border: 1px solid rgba(6, 182, 212, 0.08);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(12px);
  animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

/* Logo & Brand */
.auth-brand {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(16, 185, 129, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.2);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.1);
}
.auth-logo img {
  width: 32px;
  height: 32px;
}

.auth-brand h1 {
  font-size: var(--text-2xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-300), var(--accent-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-1);
}

.auth-brand p {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Security badge */
.auth-security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding: 6px var(--space-4);
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: var(--radius-full);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.auth-security-badge svg {
  width: 14px;
  height: 14px;
  color: var(--accent-400);
}

.auth-security-badge span {
  font-size: var(--text-xs);
  color: var(--accent-400);
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.auth-form .form-group {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-form .form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0.8rem 1rem;
  padding-left: 2.75rem;
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all var(--duration-normal) var(--ease-out);
}

.auth-form .form-input::placeholder {
  color: var(--text-muted);
}

.auth-form .form-input:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.08), 0 0 20px rgba(6, 182, 212, 0.05);
  background: rgba(15, 23, 42, 0.7);
}

.auth-form .form-input.input-error {
  border-color: var(--danger-400);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.08);
}

/* Input wrapper with icon */
.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--duration-fast);
  z-index: 2;
}

.input-wrapper:focus-within .input-icon {
  color: var(--primary-400);
}

.input-wrapper .form-input {
  padding-left: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
  z-index: 2;
}
.password-toggle:hover {
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.08);
}
.password-toggle svg {
  width: 18px;
  height: 18px;
}

/* Password strength meter */
.password-strength {
  margin-top: var(--space-2);
}

.strength-bar {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-1);
}

.strength-segment {
  flex: 1;
  height: 3px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-full);
  transition: background var(--duration-normal);
}

.strength-segment.active.weak { background: var(--danger-400); }
.strength-segment.active.fair { background: var(--warning-400); }
.strength-segment.active.good { background: var(--primary-400); }
.strength-segment.active.strong { background: var(--accent-400); }

.strength-text {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--duration-normal);
}

.strength-text.weak { color: var(--danger-400); }
.strength-text.fair { color: var(--warning-400); }
.strength-text.good { color: var(--primary-400); }
.strength-text.strong { color: var(--accent-400); }

/* Submit button */
.auth-submit {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  letter-spacing: 0.02em;
}

.auth-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.auth-submit:hover::before {
  transform: translateX(100%);
}

.auth-submit:hover {
  background: linear-gradient(135deg, var(--primary-400), var(--primary-500));
  box-shadow: 0 4px 24px rgba(6, 182, 212, 0.35);
  transform: translateY(-1px);
}
.auth-submit:active { transform: scale(0.98); }
.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-submit .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  animation: spin 0.7s linear infinite;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: var(--space-2) 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.15), transparent);
}

/* Google button */
.auth-google {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: all var(--duration-normal);
}
.auth-google:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.auth-google img {
  width: 20px; height: 20px;
}

/* Role selector */
.role-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.role-option {
  position: relative;
}
.role-option input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.role-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-3) var(--space-2);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-normal);
  text-align: center;
}
.role-option label:hover {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(6, 182, 212, 0.03);
}
.role-option label .role-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.role-option label .role-icon svg {
  width: 22px;
  height: 22px;
}
.role-option label .role-name {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
}
.role-option input:checked + label {
  border-color: var(--primary-400);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 0 1px var(--primary-400);
}
.role-option input:checked + label .role-icon {
  color: var(--primary-400);
}
.role-option input:checked + label .role-name {
  color: var(--primary-300);
}

/* Footer links */
.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.auth-footer a {
  color: var(--primary-400);
  font-weight: 600;
}
.auth-footer a:hover { color: var(--primary-300); text-decoration: underline; }

.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
}
.auth-links a {
  color: var(--primary-400);
  font-weight: 500;
}
.auth-links a:hover {
  color: var(--primary-300);
}

/* Custom checkbox */
.auth-links .remember-me {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--text-muted);
  user-select: none;
}

.auth-links .remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-500);
  cursor: pointer;
}

/* Error message */
.auth-error {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.18);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--danger-400);
  display: none;
  animation: fadeInDown var(--duration-normal) var(--ease-out);
}
.auth-error.visible { display: flex; align-items: center; gap: var(--space-2); }

/* Success message */
.auth-success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--accent-400);
  display: none;
  animation: fadeInDown var(--duration-normal) var(--ease-out);
}
.auth-success.visible { display: flex; align-items: center; gap: var(--space-2); }

/* Trust indicators at bottom */
.auth-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

/* Contact help section */
.auth-contact-help {
  background: var(--bg-card);
  padding: var(--space-6);
  margin-top: var(--space-8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.auth-contact-help h3 {
  margin-bottom: var(--space-4);
  color: var(--text-primary);
  font-size: var(--text-lg);
}

.auth-contact-help p {
  margin: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.auth-contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.auth-contact-form .form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--bg-input);
  color: var(--text-primary);
}

.auth-contact-form .form-input:focus {
  outline: none;
  border-color: var(--accent-400);
}

.auth-contact-form .auth-submit {
  width: auto;
  align-self: flex-start;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.trust-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    display: none;
  }
  .auth-form-panel {
    min-height: 100vh;
  }
}

@media (max-width: 480px) {
  .auth-form-panel {
    padding: var(--space-6) var(--space-4);
  }
  .auth-card {
    max-width: 100%;
    padding: var(--space-6) var(--space-4);
  }
  .role-selector { grid-template-columns: 1fr; }
  .auth-trust { flex-direction: column; gap: var(--space-3); }
}

/* === Background for single-panel pages (forgot-password) === */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg-primary);
}

.auth-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 400px 400px at 20% 30%, rgba(6, 182, 212, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 300px 300px at 80% 70%, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
}

/* Single-panel layout for forgot-password */
.auth-page-single {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  position: relative;
}
