/**
 * HabitFlow - Phase 3 Authentication Stylesheet
 * Integrates directly with existing design tokens & components.
 */

.auth-page-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--background);
}

.auth-header {
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.auth-main-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
}

/* Auth Card Layout */
.auth-card {
  width: 100%;
  max-width: 480px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  margin: 0 auto;
}

.auth-icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  font-size: 1.5rem;
}

.auth-title {
  font-size: clamp(1.4rem, 3.5vw, 1.85rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-6);
}

/* Plan summary snapshot */
.plan-summary-box {
  background-color: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  text-align: left;
}

.plan-summary-label {
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.plan-summary-name {
  font-weight: 800;
  color: var(--text);
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.plan-summary-details {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* 6-Digit OTP Box Grid */
.otp-input-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: var(--space-6) 0;
}

.otp-digit-input {
  width: 48px;
  height: 56px;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  text-align: center;
  color: var(--text);
  background-color: var(--surface-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
}

.otp-digit-input:focus {
  border-color: var(--primary);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.otp-digit-input.has-val {
  border-color: var(--primary);
}

/* Countdown & Resend Bar */
.otp-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: var(--space-6);
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.otp-timer {
  font-weight: 600;
  color: var(--text-secondary);
}

.otp-resend-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
}

.otp-resend-btn:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Error and feedback notice */
.auth-error-box {
  display: none;
  background-color: var(--danger-light, #FEE2E2);
  color: var(--danger, #DC2626);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: var(--space-4);
  text-align: left;
}

.auth-error-box.visible {
  display: block;
}

.auth-success-box {
  display: none;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-bottom: var(--space-4);
  text-align: center;
}

.auth-success-box.visible {
  display: block;
}

/* Email change link */
.auth-email-switch {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-4);
}

.auth-email-switch a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}
