/* ============================================
   CYFIA AUTH STYLES - Enterprise Grade
   ============================================ */

:root {
  /* Primary Colors */
  --primary: #1f6250;
  --primary-dark: #0a4a3a;
  --primary-light: #3a8a72;
  --primary-glow: rgba(31, 98, 80, 0.12);
  
  /* Accent Colors */
  --accent: #C4806B;
  --accent-dark: #a86a56;
  --accent-light: #e09882;
  
  /* Status Colors */
  --success: #3B7A4E;
  --warning: #D4953A;
  --danger: #C44B3C;
  --info: #4A7BA7;
  
  /* Background Colors */
  --bg: #FBFBF9;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F5F4F0;
  
  /* Text Colors - SMALL FONTS */
  --text: #1A1816;
  --text-secondary: #5C5854;
  --text-muted: #7A7670;
  --text-placeholder: #B0ACA6;
  
  /* Border Colors */
  --border: #E8E6DE;
  --border-focus: #D1CEC4;
  
  /* Font Sizes - SMALL */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 26px;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 6px;
  --space-md: 10px;
  --space-lg: 14px;
  --space-xl: 18px;
  --space-2xl: 22px;
  --space-3xl: 28px;
  --space-4xl: 36px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #141210;
  --bg-surface: #1A1816;
  --bg-elevated: #21201C;
  --text: #F0ECE6;
  --text-secondary: #B0ACA6;
  --text-muted: #8E8A84;
  --text-placeholder: #5C5854;
  --border: #2D2A26;
  --border-focus: #3E3B36;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Auth Container */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl) var(--space-2xl);
}

/* Auth Card - WIDER for side-by-side buttons */
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4xl);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

/* Auth Logo */
.auth-logo {
  margin-bottom: var(--space-3xl);
  display: inline-block;
  text-decoration: none;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

/* Auth Header */
.auth-header {
  margin-bottom: var(--space-3xl);
}

.auth-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-xl);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.forgot-link {
  font-size: var(--text-xs);
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* Input Wrapper */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.input-field {
  width: 100%;
  padding: 10px 36px 10px 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: var(--text-sm);
  font-family: inherit;
  font-weight: 400;
  transition: all var(--transition-fast);
}

.input-field::placeholder {
  color: var(--text-placeholder);
  font-size: var(--text-sm);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Password Toggle - NO PADDING, EXACT ICON POSITION */
.toggle-password {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 13px;
  transition: color var(--transition-fast);
  line-height: 1;
}

.toggle-password i {
  position: static;
  left: auto;
  font-size: 13px;
  margin: 0;
  padding: 0;
}

.toggle-password:hover {
  color: var(--text);
}

/* Password Strength */
.password-strength-meter {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.strength-bar {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.strength-bar.active:nth-child(1) { background: var(--danger); }
.strength-bar.active:nth-child(2) { background: var(--warning); }
.strength-bar.active:nth-child(3),
.strength-bar.active:nth-child(4) { background: var(--success); }

.strength-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  min-width: 80px;
  text-align: right;
}

/* Checkbox */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.form-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--primary);
  margin: 0;
}

.form-checkbox label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
}

.form-checkbox a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.form-checkbox a:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 9px 20px;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  font-family: inherit;
  line-height: 1;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Social Buttons Row - SIDE BY SIDE */
.social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.btn-social:hover {
  background: var(--bg-elevated);
  border-color: var(--border-focus);
}

.btn-social i {
  font-size: 14px;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin: var(--space-2xl) 0 var(--space-xl);
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

/* Auth Switch */
.auth-switch {
  text-align: center;
  margin-top: var(--space-2xl);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Theme Toggle */
.theme-toggle-auth {
  position: fixed;
  top: var(--space-xl);
  right: var(--space-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  cursor: pointer;
  z-index: 100;
  color: var(--text);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.theme-toggle-auth:hover {
  background: var(--bg-elevated);
}

/* Back Link */
.back-link {
  margin-top: var(--space-xl);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-xs);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.back-link:hover {
  color: var(--primary);
}

/* Success State */
.success-state {
  display: none;
  text-align: center;
}

.success-state.active {
  display: block;
}

.success-icon {
  width: 56px;
  height: 56px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-xl);
}

.success-icon i {
  font-size: 24px;
  color: white;
}

.success-state h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.success-state p {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.email-highlight {
  font-weight: 600;
  color: var(--primary);
  margin: var(--space-sm) 0;
  font-size: var(--text-sm);
}

/* Responsive */
@media (max-width: 480px) {
  .auth-card {
    padding: var(--space-2xl);
    max-width: 360px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .auth-title {
    font-size: var(--text-xl);
  }
  
  .social-row {
    gap: var(--space-sm);
  }
  
  .btn-social {
    padding: 6px 10px;
    font-size: 10px;
  }
  
  .btn-social i {
    font-size: 12px;
  }
  
  .theme-toggle-auth {
    top: var(--space-md);
    right: var(--space-md);
    padding: 6px 10px;
  }
}

/* Loading State */
.btn-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Password Hint */
.password-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}