/* ═══════════════════════════════════════════════
   AUTH PAGES - Ultra Minimal Corporate
   Glassmorphism, no rounded corners, flat colors
   ═══════════════════════════════════════════════ */

:root {
  --auth-bg: #070a12;
  --auth-bg-light: #f0f2f5;
  --auth-glass-bg: rgba(17, 24, 39, 0.75);
  --auth-glass-bg-light: rgba(255, 255, 255, 0.7);
  --auth-glass-border: rgba(255, 255, 255, 0.08);
  --auth-glass-border-light: rgba(0, 0, 0, 0.08);
  --auth-text: #e5e7eb;
  --auth-text-light: #1f2937;
  --auth-text-secondary: #6b7280;
  --auth-text-secondary-light: #6b7280;
  --auth-input-bg: rgba(15, 23, 42, 0.6);
  --auth-input-bg-light: rgba(255, 255, 255, 0.5);
  --auth-input-border: rgba(255, 255, 255, 0.1);
  --auth-input-border-light: rgba(0, 0, 0, 0.1);
  --auth-accent: #3483FA;
  --auth-accent-hover: #4f8efc;
  --auth-error: #ef4444;
  --auth-success: #22c55e;
}

[data-bs-theme="light"] {
  --auth-bg: var(--auth-bg-light);
  --auth-glass-bg: var(--auth-glass-bg-light);
  --auth-glass-border: var(--auth-glass-border-light);
  --auth-text: var(--auth-text-light);
  --auth-text-secondary: var(--auth-text-secondary-light);
  --auth-input-bg: var(--auth-input-bg-light);
  --auth-input-border: var(--auth-input-border-light);
}

/* ─── Global ─── */
html, body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}

.auth-page {
  background: var(--auth-bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ─── Theme Toggle ─── */
.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--auth-glass-border);
  background: var(--auth-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--auth-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.2s ease;
  z-index: 1000;
}

.theme-toggle:hover {
  border-color: var(--auth-accent);
  color: var(--auth-accent);
}

.theme-icon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: scale(0.5);
}

.theme-toggle[data-current-theme="auto"] .theme-icon-auto,
.theme-toggle[data-current-theme="light"] .theme-icon-light,
.theme-toggle[data-current-theme="dark"] .theme-icon-dark {
  opacity: 1;
  transform: scale(1);
}

/* ─── Wrapper ─── */
.auth-wrapper {
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Card - Glassmorphism ─── */
.auth-card {
  width: 100%;
  background: var(--auth-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--auth-glass-border);
  border-radius: 16px;
  overflow: hidden;
}

/* ─── Header ─── */
.auth-header {
  padding: 2rem 2.5rem 1.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo svg {
  flex-shrink: 0;
}

.brand-name {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--auth-text);
  letter-spacing: -0.01em;
}

/* ─── Body ─── */
.auth-body {
  padding: 0 2.5rem 2rem;
}

/* ─── Form Header ─── */
.form-header {
  margin-bottom: 1.75rem;
}

.form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--auth-text);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* ─── Custom Alerts ─── */
.auth-alert {
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-left: 3px solid;
  background: transparent;
}

.auth-alert-success {
  color: var(--auth-success);
  border-left-color: var(--auth-success);
}

.auth-alert-error {
  color: var(--auth-error);
  border-left-color: var(--auth-error);
}

/* ─── Form ─── */
.auth-form {
  margin-top: 0.5rem;
}

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

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--auth-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  font-size: 0.95rem;
  border: 1px solid var(--auth-input-border);
  border-radius: 8px;
  background: var(--auth-input-bg);
  color: var(--auth-text);
  transition: all 0.15s ease;
}

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

.form-control::placeholder {
  color: var(--auth-text-secondary);
  opacity: 0.4;
}

/* Password Wrapper */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper .form-control {
  padding-right: 5rem;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--auth-text-secondary);
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}

.password-toggle:hover {
  color: var(--auth-accent);
}

/* ─── OTP Inputs ─── */
.otp-container {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  border: 1px solid var(--auth-input-border);
  border-radius: 8px;
  background: var(--auth-input-bg);
  color: var(--auth-text);
  transition: all 0.15s ease;
}

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

/* ─── Checkbox ─── */
.form-options {
  margin-bottom: 1.5rem;
}

.checkbox-custom {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-custom input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-check {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1px solid var(--auth-input-border);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  background: var(--auth-input-bg);
}

.checkbox-custom input[type="checkbox"]:checked + .checkbox-check {
  background: var(--auth-accent);
  border-color: var(--auth-accent);
}

.checkbox-custom input[type="checkbox"]:checked + .checkbox-check::after {
  content: '';
  width: 10px;
  height: 10px;
  background: white;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox-label {
  font-size: 0.8rem;
  color: var(--auth-text-secondary);
  line-height: 1.4;
}

/* ─── Button ─── */
.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
  border-radius: 8px;
  background: var(--auth-accent);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-auth:hover {
  background: var(--auth-accent-hover);
}

.btn-auth:active {
  opacity: 0.9;
}

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

/* ─── QR Section ─── */
.qr-section {
  text-align: center;
  margin-bottom: 1.5rem;
}

.qr-code-container {
  display: inline-block;
  padding: 0.75rem;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  border-radius: 12px;
}

.qr-code-image {
  width: 180px;
  height: 180px;
  display: block;
}

.qr-app-text {
  font-size: 0.75rem;
  color: var(--auth-text-secondary);
  margin: 0.75rem 0 0 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ─── Footer ─── */
.auth-footer {
  padding: 1rem 2.5rem;
  border-top: 1px solid var(--auth-glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-size: 0.6rem;
  color: var(--auth-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.footer-version {
  font-size: 0.6rem;
  color: var(--auth-text-secondary);
  font-family: 'SF Mono', 'Menlo', monospace;
  letter-spacing: 0.02em;
}

/* ─── Responsive Mobile ─── */
@media (max-width: 520px) {
  .auth-wrapper {
    padding: 0;
    max-width: 100%;
    align-items: flex-start;
    padding-top: 5rem;
  }
  
  .auth-card {
    border: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  
  .auth-header {
    padding: 1.5rem 1.5rem 1rem;
  }
  
  .auth-body {
    padding: 0 1.5rem 1.5rem;
  }
  
  .auth-footer {
    padding: 1rem 1.5rem;
    border-top-color: var(--auth-input-border);
  }
  
  .form-title {
    font-size: 1.35rem;
  }
  
  .form-control {
    height: 52px;
    font-size: 1rem;
  }
  
  .btn-auth {
    height: 52px;
    font-size: 0.9rem;
  }
  
  .otp-input {
    width: 44px;
    height: 52px;
    font-size: 1.15rem;
  }
  
  .theme-toggle {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  
  .qr-code-image {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 360px) {
  .auth-wrapper {
    padding-top: 4rem;
  }
  
  .auth-header {
    padding: 1.25rem 1.25rem 0.875rem;
  }
  
  .auth-body {
    padding: 0 1.25rem 1.25rem;
  }
  
  .auth-footer {
    padding: 0.875rem 1.25rem;
  }
  
  .form-title {
    font-size: 1.25rem;
  }
  
  .otp-input {
    width: 40px;
    height: 48px;
  }
}
