/*
 * auth.css — KauID Authentication Pages
 * Apple-inspired design system. Standalone. No Tailwind. No DaisyUI.
 *
 * All auth pages (login, register, forgot-password, reset-password,
 * MFA, onboarding, step-up) use these classes exclusively.
 * Zero inline styles allowed.
 *
 * Created: 2026-03-26
 */

/* ===== Google Fonts: Inter ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

/* ===== Reset for auth pages ===== */
/* When .auth-page is on body or a wrapper, override DaisyUI/Tailwind dark themes */
.auth-page,
.auth-page *,
.auth-page [data-theme] {
  color-scheme: light !important;
}

.auth-page {
  background: #ffffff !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

/* ===== Layout ===== */
.auth-container {
  width: 100%;
  max-width: 380px;
}

.auth-logo-section {
  text-align: center;
  margin-bottom: 40px;
}

.auth-logo {
  display: block;
  margin: 0 auto 20px auto;
  height: 48px;
  width: auto;
}

.auth-tagline {
  font-size: 15px;
  color: #86868b;
  margin: 0;
}

/* ===== Card ===== */
.auth-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 32px;
}

.auth-card-centered {
  text-align: center;
}

/* ===== Typography ===== */
.auth-heading {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
  margin: 0 0 24px 0;
}

.auth-heading-centered {
  text-align: center;
}

.auth-heading-tight {
  margin-bottom: 8px;
}

.auth-subheading {
  font-size: 15px;
  color: #86868b;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.auth-subheading-centered {
  text-align: center;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: #86868b;
}

/* ===== Form Elements ===== */
.auth-field {
  margin-bottom: 16px;
}

.auth-field-last {
  margin-bottom: 20px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 10px 14px;
  background: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.auth-input::placeholder {
  color: #86868b;
}

.auth-input:focus {
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

/* ===== Buttons ===== */
.auth-btn {
  width: 100%;
  padding: 12px 16px;
  background: #007AFF;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  display: block;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.auth-btn:hover {
  background: #0066DD;
}

.auth-btn:active {
  background: #0055BB;
}

.auth-btn-secondary {
  background: #f5f5f7;
  color: #1d1d1f;
}

.auth-btn-secondary:hover {
  background: #e8e8ed;
}

.auth-btn-secondary:active {
  background: #d2d2d7;
}

/* ===== Links ===== */
.auth-link {
  font-size: 14px;
  color: #007AFF;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-link-block {
  display: block;
  text-align: center;
  margin-top: 16px;
}

.auth-link-small {
  font-size: 12px;
}

/* ===== Messages ===== */
.auth-error {
  background: rgba(255, 59, 48, 0.06);
  border: 1px solid rgba(255, 59, 48, 0.15);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.auth-error p,
.auth-error-text {
  font-size: 14px;
  color: #FF3B30;
  margin: 0;
}

.auth-success {
  background: rgba(52, 199, 89, 0.06);
  border: 1px solid rgba(52, 199, 89, 0.15);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.auth-success p,
.auth-success-text {
  font-size: 14px;
  color: #34C759;
  margin: 0;
}

.auth-info {
  background: rgba(0, 122, 255, 0.06);
  border: 1px solid rgba(0, 122, 255, 0.15);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.auth-info p,
.auth-info-text {
  font-size: 14px;
  color: #007AFF;
  margin: 0;
}

/* ===== Success Icon ===== */
.auth-success-icon {
  width: 48px;
  height: 48px;
  background: rgba(52, 199, 89, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.auth-success-icon svg {
  width: 24px;
  height: 24px;
}

/* ===== Link List (no-tenant page) ===== */
.auth-link-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-link-list a {
  display: block;
  padding: 12px 16px;
  background: #f5f5f7;
  border-radius: 10px;
  color: #1d1d1f;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: background 0.15s;
}

.auth-link-list a:hover {
  background: #e8e8ed;
}

/* ===== MFA / OTP Input ===== */
.auth-otp-input {
  width: 100%;
  padding: 14px;
  background: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  font-size: 24px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  letter-spacing: 0.5em;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.auth-otp-input:focus {
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

/* ===== Backup Codes ===== */
.auth-codes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-code {
  background: #f5f5f7;
  border-radius: 8px;
  padding: 10px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  color: #1d1d1f;
  text-align: center;
  letter-spacing: 0.05em;
}

/* ===== QR Code ===== */
.auth-qr-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-qr-wrapper img,
.auth-qr-wrapper svg {
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ===== Manual Secret ===== */
.auth-secret {
  background: #f5f5f7;
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  color: #1d1d1f;
  text-align: center;
  word-break: break-all;
  margin-bottom: 24px;
}

/* ===== Divider ===== */
.auth-divider {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin: 24px 0;
}

/* ===== Helper text ===== */
.auth-helper {
  font-size: 13px;
  color: #86868b;
  margin: 8px 0 0 0;
  line-height: 1.4;
}

.auth-helper-centered {
  text-align: center;
}

/* ===== Spacing utilities (minimal) ===== */
.auth-mt-16 { margin-top: 16px; }
.auth-mt-24 { margin-top: 24px; }
.auth-mb-8 { margin-bottom: 8px; }
.auth-mb-16 { margin-bottom: 16px; }
.auth-mb-24 { margin-bottom: 24px; }

/* ===== Steps indicator (onboarding) ===== */
.auth-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.auth-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
}

.auth-step-dot-active {
  background: #007AFF;
  width: 24px;
  border-radius: 4px;
}

.auth-step-dot-complete {
  background: #34C759;
}

/* ===== Method Selection (radio list for MFA/step-up) ===== */
.auth-method-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-method-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 12px 14px;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  transition: border-color 0.2s;
}

.auth-method-option:hover {
  border-color: rgba(0, 122, 255, 0.3);
}

.auth-method-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  accent-color: #007AFF;
  flex-shrink: 0;
}

.auth-method-name {
  font-weight: 500;
  color: #1d1d1f;
}

/* ===== Info detail (email display etc.) ===== */
.auth-detail-value {
  font-weight: 500;
  color: #1d1d1f;
}

/* ===== Button row (side by side) ===== */
.auth-btn-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-btn-row .auth-btn,
.auth-btn-row .auth-btn-secondary {
  flex: 1;
}

/* ===== Details/summary toggle ===== */
.auth-details-toggle {
  cursor: pointer;
  user-select: none;
}

/* ===== QR code container override ===== */
.auth-qr-container {
  padding: 16px;
}

/* ===== Hidden utility ===== */
.auth-hidden {
  display: none !important;
}

/* ===== Responsive (already good at 380px max-width, but ensure mobile is fine) ===== */
@media (max-width: 420px) {
  .auth-page {
    padding: 24px 16px;
  }

  .auth-card {
    padding: 24px;
    border-radius: 12px;
  }

  .auth-logo-section {
    margin-bottom: 32px;
  }
}
