/* ═══════════════════════════════════════════════════════════════════════
   RTA Labs OMNI — Authentication Pages
   Aesthetic: "Clean White SaaS" — Light-first
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ─── DESIGN TOKENS (Light-first) ─── */
:root {
  /* Clean White Surfaces */
  --bg-void: #ffffff;
  --bg-primary: #f8f9fb;
  --bg-elevated: #ffffff;
  --bg-surface: #f4f5f7;
  --bg-panel: rgba(255, 255, 255, 0.88);
  --bg-glass: rgba(255, 255, 255, 0.72);

  /* RTA Labs Blue */
  --cosmic: #2d7ce0;
  --cosmic-deep: #1d6cd0;
  --cosmic-light: #4a9eff;
  --cosmic-glow: rgba(45, 124, 224, 0.2);
  --cosmic-subtle: rgba(45, 124, 224, 0.06);
  --cosmic-border: rgba(45, 124, 224, 0.15);

  /* Text — high contrast on white */
  --text-primary: #1a1d26;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-faint: #a0aec0;

  /* Edges */
  --edge: rgba(0, 0, 0, 0.08);
  --edge-hover: rgba(45, 124, 224, 0.3);

  /* Status */
  --emerald: #059669;
  --coral: #dc2626;

  /* Depth — light shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 4px 20px rgba(45, 124, 224, 0.08);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.4s;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light mode override removed — auth pages are always light */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.7;
}


/* ═══════════════════════════════════════════════════════════════════════
   AUTH WRAPPER — Full-viewport cinematic backdrop
   ═══════════════════════════════════════════════════════════════════════ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-void);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Noise grain overlay */
.auth-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Radial cosmic glow — command bridge ambiance */
.auth-wrapper::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(45, 124, 224, 0.04) 0%, transparent 65%);
  pointer-events: none;
  animation: authGlow 20s ease-in-out infinite alternate;
}

@keyframes authGlow {
  0% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateX(-50%) scale(1.15);
    opacity: 0.6;
  }
}

[data-theme="light"] .auth-wrapper::before {
  opacity: 0.01;
}

[data-theme="light"] .auth-wrapper::after {
  background: radial-gradient(circle, rgba(45, 124, 224, 0.04) 0%, transparent 65%);
}


/* ═══════════════════════════════════════════════════════════════════════
   AUTH CARD — Glass panel with cosmic edge
   ═══════════════════════════════════════════════════════════════════════ */
.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  background: var(--bg-surface);
  border: 1px solid var(--edge);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-lg);
  animation: cardEntry 0.6s var(--ease);
}

/* Top glow line */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 2rem;
  right: 2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cosmic), transparent);
  opacity: 0.4;
}

@keyframes cardEntry {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Brand mark */
.auth-brand {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.auth-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--cosmic);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  box-shadow: 0 4px 16px var(--cosmic-glow);
}

.auth-brand-img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
  filter: drop-shadow(0 4px 16px rgba(74, 158, 255, 0.25));
}

.auth-brand-text {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 3px;
  color: var(--text-primary);
  text-transform: uppercase;
}

/* Title */
.auth-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 0.375rem;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
}

.auth-subtitle a {
  color: var(--cosmic);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--duration);
}

.auth-subtitle a:hover {
  color: var(--cosmic-light);
}


/* ═══════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 500px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.form-label .required {
  color: var(--cosmic);
  margin-left: 2px;
}

/* ── Input styling: both .form-input class AND bare elements ── */
.form-input,
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="url"],
.auth-card input[type="tel"],
.auth-card input[type="number"],
.auth-card input[type="search"],
.auth-card textarea,
.auth-card select,
.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: all var(--duration) var(--ease);
  outline: none;
}

.form-input:focus,
.auth-card input:focus,
.auth-card textarea:focus,
.auth-card select:focus,
.modal-content input:focus {
  border-color: var(--cosmic);
  box-shadow: 0 0 0 3px var(--cosmic-subtle), 0 0 20px rgba(74, 158, 255, 0.06);
  background: var(--bg-surface);
}

.form-input::placeholder,
.auth-card input::placeholder,
.auth-card textarea::placeholder,
.modal-content input::placeholder {
  color: var(--text-faint);
}

.form-section {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--edge);
}

.form-section h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.form-help {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 0.375rem;
}

/* ── Checkbox label ── */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--cosmic);
  flex-shrink: 0;
}

.checkbox-label a {
  color: var(--cosmic);
  text-decoration: none;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

/* ── Forgot password link ── */
.forgot-link {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--cosmic);
  text-decoration: none;
  margin-bottom: 1.25rem;
  text-align: right;
  transition: color var(--duration) var(--ease);
}

.forgot-link:hover {
  color: var(--cosmic-deep);
  text-decoration: underline;
}


/* ═══════════════════════════════════════════════════════════════════════
   AUTH BUTTONS
   ═══════════════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.875rem;
  background: var(--cosmic);
  color: white;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--cosmic-glow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all var(--duration) var(--ease);
  text-decoration: none;
}

/* Shimmer sweep */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.btn-primary:hover {
  background: var(--cosmic-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 30px rgba(74, 158, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover::after {
  transform: translateX(100%);
}


/* ═══════════════════════════════════════════════════════════════════════
   SOCIAL / DIVIDER
   ═══════════════════════════════════════════════════════════════════════ */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--edge);
}

.social-buttons {
  display: flex;
  gap: 0.625rem;
}

.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem;
  background: var(--bg-elevated);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  margin-bottom: 0.625rem;
}

.btn-social:hover {
  border-color: var(--edge-hover);
  background: var(--bg-surface);
  transform: translateY(-1px);
}

.btn-social.google:hover {
  border-color: rgba(66, 133, 244, 0.4);
}

.btn-social.github:hover {
  border-color: rgba(140, 140, 140, 0.4);
}

.btn-social svg,
.btn-social img {
  width: 18px;
  height: 18px;
}


/* ═══════════════════════════════════════════════════════════════════════
   AUTH MESSAGES
   ═══════════════════════════════════════════════════════════════════════ */
.auth-message {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-message.error {
  background: rgba(248, 113, 113, 0.08);
  color: var(--coral);
  border: 1px solid rgba(248, 113, 113, 0.15);
}

.auth-message.success {
  background: rgba(52, 211, 153, 0.08);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.15);
}


/* ═══════════════════════════════════════════════════════════════════════
   AUTH FOOTER
   ═══════════════════════════════════════════════════════════════════════ */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--cosmic);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Terms group (legacy) */
.terms-group {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}

.terms-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--cosmic);
  flex-shrink: 0;
}

.terms-group label {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.terms-group label a {
  color: var(--cosmic);
  text-decoration: none;
}

.terms-group label a:hover {
  text-decoration: underline;
}


/* ═══════════════════════════════════════════════════════════════════════
   MODAL (Forgot Password)
   ═══════════════════════════════════════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.modal-content h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modal-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Auth pages are always light — no theme toggle needed */