/* ============================================================
   AltWealth – Auth Pages Shared Stylesheet
   Covers: login.html | register.html | forgot-password.html
   ============================================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --brand-navy: #0D1B2A;
  --brand-deep: #132337;
  --brand-gold: #C9A84C;
  --brand-gold-lt: #E2C47A;
  --brand-gold-dk: #A07830;
  --brand-teal: #0A9396;
  --brand-cream: #F8F4EC;
  --text-primary: #1A2B3C;
  --text-secondary: #4A6080;
  --text-muted: #8097B0;
  --border: #D8E4EF;
  --surface: #FFFFFF;
  --error: #D94040;
  --success: #2E7D4F;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 8px 40px rgba(13, 27, 42, .14);
  --shadow-input: 0 2px 8px rgba(13, 27, 42, .06);
  --transition: .22s cubic-bezier(.4, 0, .2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: var(--brand-cream);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Auth Layout ---------- */
.auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: transparent;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.bg-iframe {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border: none;
  z-index: -2;
  pointer-events: none;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: -1;
  pointer-events: none;
}

.auth-wrapper {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 860px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  position: relative;
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 26px;
  cursor: pointer;
  color: #6b7280;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  border-radius: 50%;
  text-decoration: none;
}

.auth-close:hover {
  color: #111827;
  background: #f3f4f6;
}

/* Left panel – brand */
.auth-brand {
  width: 44%;
  background: var(--brand-navy);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 40px;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(201, 168, 76, .18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 10%, rgba(10, 147, 150, .12) 0%, transparent 70%);
  pointer-events: none;
}

/* geometric accent circles */
.auth-brand::after {
  content: '';
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 168, 76, .15);
  pointer-events: none;
}

.brand-inner-ring {
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 168, 76, .1);
  pointer-events: none;
}

.auth-brand-logo {
  position: relative;
  z-index: 1;
}

.auth-brand-logo img {
  height: 38px;
  filter: brightness(0) invert(1);
}

.auth-brand-content {
  position: relative;
  z-index: 1;
}

.auth-brand-tagline {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  letter-spacing: -.02em;
  margin-bottom: 20px;
}

.auth-brand-tagline em {
  font-style: normal;
  color: var(--brand-gold);
}

.auth-brand-desc {
  font-size: .95rem;
  color: rgba(255, 255, 255, .6);
  line-height: 1.65;
  max-width: 340px;
}

.auth-brand-stats {
  display: flex;
  gap: 32px;
  position: relative;
  z-index: 1;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-gold);
  letter-spacing: -.02em;
}

.stat-label {
  font-size: .75rem;
  color: rgba(255, 255, 255, .5);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Right panel – form */
.auth-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 48px;
  background: var(--surface);
}

.auth-card {
  width: 100%;
  max-width: 100%;
}

.auth-card-header {
  margin-bottom: 32px;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color var(--transition);
}

.auth-back-link:hover {
  color: var(--brand-navy);
}

.auth-back-link i {
  font-size: .7rem;
}

.auth-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.025em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ---------- Form Elements ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.form-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-wrap .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: .85rem;
  pointer-events: none;
  transition: color var(--transition);
}

.form-input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  font-size: .92rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-input);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.form-input:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, .15);
}

.form-input:focus+.input-icon,
.form-input-wrap:focus-within .input-icon {
  color: var(--brand-gold-dk);
}

/* password toggle */
.input-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .8rem;
  padding: 4px;
  transition: color var(--transition);
}

.input-toggle:hover {
  color: var(--text-primary);
}

.form-input.has-toggle {
  padding-right: 38px;
}

/* field hint */
.field-hint {
  font-size: .76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* error state */
.form-group.has-error .form-input {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(217, 64, 64, .1);
}

.form-group.has-error .field-error {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .76rem;
  color: var(--error);
}

.field-error {
  display: none;
}

/* success state */
.form-group.has-success .form-input {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(46, 125, 79, .1);
}

/* password strength bar */
.password-strength {
  margin-top: 6px;
}

.strength-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width .4s ease, background .4s ease;
}

.strength-fill.w-25 {
  width: 25%;
  background: #E53E3E;
}

.strength-fill.w-50 {
  width: 50%;
  background: #DD6B20;
}

.strength-fill.w-75 {
  width: 75%;
  background: #D69E2E;
}

.strength-fill.w-100 {
  width: 100%;
  background: var(--success);
}

.strength-text {
  font-size: .74rem;
  color: var(--text-muted);
}

/* checkbox */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.form-check input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--brand-navy);
  cursor: pointer;
  flex-shrink: 0;
}

.form-check label {
  font-size: .84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: pointer;
}

.form-check a {
  color: var(--brand-navy);
  text-decoration: underline;
}

/* ---------- Form Meta Row ---------- */
.form-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .83rem;
}

.form-meta a {
  color: var(--brand-navy);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.form-meta a:hover {
  color: var(--brand-gold-dk);
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 24px;
  font-size: .95rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--brand-navy);
  background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-lt) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: .01em;
  transition: opacity var(--transition), box-shadow var(--transition), transform var(--transition);
  box-shadow: 0 4px 16px rgba(201, 168, 76, .35);
  margin-top: 4px;
}

.btn-primary:hover {
  opacity: .92;
  box-shadow: 0 6px 24px rgba(201, 168, 76, .45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.loading {
  pointer-events: none;
  opacity: .75;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(13, 27, 42, .25);
  border-top-color: var(--brand-navy);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}

.btn-primary.loading .btn-spinner {
  display: block;
}

.btn-primary.loading .btn-label {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Divider ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--text-muted);
  font-size: .8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Social Buttons ---------- */
.social-buttons {
  display: flex;
  flex-direction: row;
  gap: 16px;
}

.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  font-size: .88rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-input);
}

.btn-social:hover {
  background: #f7fafd;
  border-color: #bfcfdf;
  box-shadow: 0 4px 12px rgba(13, 27, 42, .08);
}

.btn-social .social-icon {
  display: flex;
  align-items: center;
}

.btn-social-whatsapp {
  color: #128C7E;
}

.btn-social-whatsapp:hover {
  border-color: #128C7E;
  background: #f0faf8;
}

/* ---------- Auth Footer ---------- */
.auth-footer-note {
  text-align: center;
  font-size: .84rem;
  color: var(--text-muted);
  margin-top: 24px;
}

.auth-footer-note a {
  color: var(--brand-navy);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
}

.auth-footer-note a:hover {
  color: var(--brand-gold-dk);
}

/* ---------- OTP Inputs ---------- */
.otp-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 12px 0;
}

.otp-input {
  width: 52px;
  height: 56px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  caret-color: var(--brand-gold);
}

.otp-input:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, .15);
}

.otp-resend {
  text-align: center;
  font-size: .84rem;
  color: var(--text-muted);
}

.otp-resend button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand-navy);
  font-weight: 600;
  font-family: inherit;
  font-size: .84rem;
  transition: color var(--transition);
}

.otp-resend button:hover {
  color: var(--brand-gold-dk);
}

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

/* ---------- Step Indicator ---------- */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--text-muted);
}

.step.active {
  color: var(--brand-navy);
  font-weight: 600;
}

.step.done {
  color: var(--success);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.step.active .step-num {
  background: var(--brand-navy);
  color: #fff;
}

.step.done .step-num {
  background: var(--success);
  color: #fff;
}

.step-connector {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Info Box ---------- */
.info-box {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(10, 147, 150, .06);
  border: 1px solid rgba(10, 147, 150, .2);
  border-radius: var(--radius-sm);
  font-size: .83rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.info-box i {
  color: var(--brand-teal);
  margin-top: 2px;
  flex-shrink: 0;
}

/* ---------- Alert Banner ---------- */
.form-alert {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  font-weight: 500;
}

.form-alert.show {
  display: flex;
}

.form-alert.error {
  background: rgba(217, 64, 64, .08);
  border: 1px solid rgba(217, 64, 64, .25);
  color: var(--error);
}

.form-alert.success {
  background: rgba(46, 125, 79, .08);
  border: 1px solid rgba(46, 125, 79, .25);
  color: var(--success);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-form-panel {
    padding: 40px 24px;
  }

  .auth-card {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .auth-form-panel {
    padding: 32px 16px;
  }
}