/* ══════════════════════════════════════════════
   AUTH.CSS — Avtarium Auth Pages
   Login, Register, Password Reset, 2FA
   Lightweight: ~15 KB vs 80 KB app.css
   ══════════════════════════════════════════════ */

/* ══════════════════════════════════════════════
   1. SETTINGS - VARIABLES
   ══════════════════════════════════════════════ */

:root {
  /* Colors - Dark Theme Only */
  --bg-deep: #060a10;
  --bg-main: #0a0f18;
  --bg-card: #0f1520;
  --bg-card-hover: #141c2a;
  --border: #1a2535;

  /* Primary Accent */
  --mint: #00D9A5;
  --mint-hover: #00f5c4;
  --mint-glow: rgba(0, 217, 165, 0.2);
  --mint-soft: rgba(0, 217, 165, 0.1);

  /* Text Colors */
  --text: #cbd5e1;
  --text-secondary: #8b9cb3;
  --text-muted: #5a6a7f;
  --muted-dark: #475569;

  /* Aliases */
  --bg: var(--bg-main);
  --bg-elevated: var(--bg-card);
  --card: var(--bg-card);
  --line: var(--border);
  --muted: var(--text-muted);
  --surface: var(--bg-card);

  /* Semantic Colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-xs: 10px;
  --font-sm: 13px;
  --font-md: 16px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Border Radius */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;
}

/* ══════════════════════════════════════════════
   2. RESET
   ══════════════════════════════════════════════ */

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

html {
  font-size: var(--font-md);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-main);
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: var(--mint);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--mint-hover);
}

/* ══════════════════════════════════════════════
   3. AUTH LAYOUT
   ══════════════════════════════════════════════ */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.auth-card {
  box-shadow: 0 0 40px rgba(0, 217, 165, 0.15), 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 2rem;
  margin: 0 auto;
  box-sizing: border-box;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--mint);
  margin-bottom: 0.75rem;
}

.auth-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--muted);
  font-size: 0.875rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

.auth-footer a {
  color: var(--mint);
}

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

/* ══════════════════════════════════════════════
   4. FORMS
   ══════════════════════════════════════════════ */

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea,
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-main);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-control:focus {
  outline: none;
  border-color: rgba(0, 217, 165, 0.45);
  box-shadow: 0 0 0 2px rgba(0, 217, 165, 0.07);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted);
}

.form-hint {
  margin-top: var(--space-1);
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.form-error {
  color: var(--danger);
  font-size: var(--font-xs);
  margin-top: var(--space-1);
}

/* ══════════════════════════════════════════════
   5. BUTTONS
   ══════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--mint);
  color: #000;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: var(--font-xs);
}

/* ══════════════════════════════════════════════
   6. ALERTS
   ══════════════════════════════════════════════ */

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-error,
.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

/* ══════════════════════════════════════════════
   7. UTILITIES (minimal)
   ══════════════════════════════════════════════ */

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.text-mint { color: var(--mint); }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.text-sm { font-size: var(--font-sm); }
.text-lg { font-size: 1.75rem; }
.hidden { display: none !important; }
.text-3rem-mb4 { font-size: 3rem; margin-bottom: 1rem; }

.row-mb5 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.accent-mint {
  accent-color: var(--mint);
}

/* Чекбокс дизайн-системы (.chk) — auth.css не грузит app.css, цвета захардкожены */
.chk {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: var(--font-sm);
  color: var(--muted);
  user-select: none;
}
.chk.chk-top { align-items: flex-start; }
.chk input { position: absolute; opacity: 0; width: 0; height: 0; }
.chk .box {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1px solid #243045;
  border-radius: 6px;
  background: var(--bg-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.chk.chk-top .box { margin-top: 2px; }
.chk .box svg {
  width: 12px;
  height: 12px;
  stroke: #060a10;
  stroke-width: 3;
  fill: none;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.15s;
}
.chk:hover .box { border-color: rgba(0, 217, 165, 0.5); }
.chk input:checked + .box { background: #138a6e; border-color: #138a6e; }
.chk input:checked + .box svg { opacity: 1; transform: scale(1); }
.chk input:focus-visible + .box { box-shadow: 0 0 0 2px rgba(0, 217, 165, 0.07); }
.chk input:disabled + .box { opacity: 0.4; }

/* ══════════════════════════════════════════════
   8. MOBILE RESPONSIVE
   ══════════════════════════════════════════════ */

@media (max-width: 480px) {
  .auth-container {
    padding: 1rem;
    align-items: flex-start;
    padding-top: 2rem;
  }
  .auth-card {
    padding: 1.5rem;
    border-radius: 12px;
    max-width: 100%;
  }
  .auth-logo {
    font-size: 1.25rem;
  }
  .auth-title {
    font-size: 1.125rem;
  }
  .row-mb5 {
    flex-direction: column;
    align-items: flex-start;
  }
}
