.auth_page { padding-top: var(--space-2xl); }

/* ==========================================================
   2. Header (back button)
   ========================================================== */
.auth-header {
  display: flex;
  align-items: center;
  padding: var(--space-sm);
  flex-shrink: 0;
}

.auth-header__back {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-circle);
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.auth-header__back:hover {
  background: var(--color-gray-100);
}


/* ==========================================================
   3. Steps & body
   ========================================================== */
.auth-step {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.auth-step.is-hidden {
  display: none;
}

.auth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
}

.auth-body--centered {
  align-items: center;
  justify-content: center;
  text-align: center;
}


/* ==========================================================
   4. Typography (title / subtitle)
   ========================================================== */
.auth-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  line-height: var(--line-height-tight);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.auth-subtitle {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  text-align: center;
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-xl);
}

.auth-subtitle strong {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}


/* ==========================================================
   5. Phone input
   ========================================================== */
.auth-phone {
  display: flex;
  align-items: center;
  height: 56px;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  padding: 0 var(--space-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  margin-bottom: var(--space-lg);
}


.auth-phone:hover, .auth-phone:focus-within {
  border-color: var(--color-gray-400);
}


.auth-phone__prefix {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  white-space: nowrap;
  user-select: none;
  margin-right: var(--space-md);
  flex-shrink: 0;
}

.auth-phone__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.auth-phone__input::placeholder {
  color: var(--color-text-hint);
  font-weight: var(--font-weight-bold);
}


/* ==========================================================
   6. Agreements (layout wrapper — checkbox styles in base.css)
   ========================================================== */
.auth-agreements {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding:0 var(--space-lg);
  margin-bottom: var(--space-xl);
}


/* ==========================================================
   7. CTA button (disabled state)
   ========================================================== */
.auth-cta {
  margin-top: auto;
  padding-top: var(--space-lg);
}

.auth-submit-btn:disabled,
.auth-submit-btn[disabled] {
  background: var(--color-gray-300);
  color: var(--color-white);
  cursor: not-allowed;
  opacity: 1;
  pointer-events: none;
}


/* ==========================================================
   8. OTP input
   ========================================================== */
.auth-otp {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.auth-otp__input {
  width: 56px;
  height: 64px;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  background: var(--color-white);
  font-family: var(--font-family);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  text-align: center;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  caret-color: var(--color-primary);
}

.auth-otp__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(225, 63, 41, 0.12);
}

.auth-otp__input.is-error {
  border-color: var(--color-primary);
  color: var(--color-primary);
  animation: auth-shake 0.4s ease;
}

.auth-otp__input.is-success {
  border-color: var(--color-success);
  color: var(--color-success);
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}


/* ==========================================================
   9. OTP error
   ========================================================== */
.auth-otp-error {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.auth-otp-error.is-hidden {
  display: none;
}


/* ==========================================================
   10. Resend timer
   ========================================================== */
.auth-resend {
  text-align: center;
  margin-top: var(--space-md);
}

.auth-resend__text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

#auth-timer {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.auth-resend__btn {
  display: inline-block;
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
  cursor: pointer;
  padding: var(--space-sm) 0;
  -webkit-tap-highlight-color: transparent;
  transition: opacity var(--transition-fast);
}

.auth-resend__btn:hover {
  opacity: 0.7;
}

.auth-resend__btn.is-hidden {
  display: none;
}


/* ==========================================================
   11. Success screen
   ========================================================== */
.auth-success-icon {
  font-size: 64px;
  color: var(--color-success);
  margin-bottom: var(--space-lg);
}

.auth-success-icon i {
  display: block;
}

#auth-step-success .auth-title {
  margin-bottom: var(--space-xs);
}

#auth-step-success .auth-subtitle {
  margin-bottom: var(--space-xl);
}

#auth-step-success .auth-cta {
  width: 100%;
}


/* ==========================================================
   12. Utilities
   ========================================================== */
.is-hidden {
  display: none !important;
}


/* ==========================================================
   13. Media Queries
   ========================================================== */

/* Tablet: >= 769px */
@media screen and (min-width: 769px) {
  .auth-modal__content {
    max-width: 440px;
    height: auto;
    max-height: 95vh;
    margin: auto;
    border-radius: var(--radius-xl);
    transform: translateY(40px);
    opacity: 0;
    transition: transform var(--transition-base), opacity var(--transition-base);
  }

  .auth-modal.is-open .auth-modal__content {
    transform: translateY(0);
    opacity: 1;
  }

  .auth-body {
    padding: var(--space-lg) var(--space-xl) var(--space-xl);
  }
}
