:root {
  --brand-gold: #8a6d3b;
  --brand-gold-dark: #6f5730;
  --brand-cream: #f7f3ec;
  --brand-cream-deep: #f0e6d6;
  --text-dark: #2c2620;
  --text-muted: #7a7368;
  --danger: #c62828;
  --success: #2e7d32;
  --border-soft: #e7e0d3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--text-dark);
  background: linear-gradient(180deg, #fbf8f2 0%, #f3ece0 100%);
  min-height: 100vh;
}

h1, h2 {
  font-family: 'Cormorant Garamond', serif;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(138, 109, 59, 0.12);
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  position: relative;
}

.logo-mark {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-gold);
  text-decoration: none;
  margin-bottom: 16px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-gold);
  background: var(--brand-cream);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}

.auth-card h1 {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.auth-card p {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-bottom: 0;
}

/* Step tracker */
.step-tracker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 18px 0 26px;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-soft);
  transition: background 0.25s ease, transform 0.25s ease;
}

.step-dot.active {
  background: var(--brand-gold);
  transform: scale(1.2);
}

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

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

/* Form controls */
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-control {
  border: 1.5px solid var(--border-soft);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.95rem;
  background: #fffdfa;
}

.form-control:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(138, 109, 59, 0.12);
}

/* Password visibility toggle */
.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.password-toggle:hover {
  color: var(--brand-gold);
  background: var(--brand-cream);
}

.password-toggle svg {
  width: 19px;
  height: 19px;
}

.btn-brand {
  background: var(--brand-gold);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-brand:hover, .btn-brand:focus {
  background: var(--brand-gold-dark);
  color: #fff;
}

.btn-brand:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* OTP boxes */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.otp-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  border: 1.5px solid var(--border-soft);
  border-radius: 10px;
  background: #fffdfa;
  color: var(--text-dark);
}

.otp-box:focus {
  outline: none;
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(138, 109, 59, 0.12);
}

.otp-box.error {
  border-color: var(--danger);
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.resend-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

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

.back-step-btn {
  display: block;
  margin: 18px auto 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.back-step-btn:hover {
  color: var(--brand-gold);
}

/* Success state */
.success-check {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--brand-cream);
  color: var(--success);
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Alert */
.alert {
  border-radius: 10px;
  font-size: 0.88rem;
  padding: 12px 14px;
}

.alert-success {
  background: #eaf5ea;
  color: var(--success);
  border: 1px solid #c8e6c9;
}

.alert-danger {
  background: #fdecec;
  color: var(--danger);
  border: 1px solid #f5c6c6;
}

/* Links */
.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  font-size: 0.85rem;
}

.auth-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.auth-links a:hover {
  color: var(--brand-gold);
}

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--brand-gold);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 8px 20px rgba(138,109,59,0.25);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 480px) {
  .auth-card { padding: 30px 22px; }
  .otp-box { font-size: 1.15rem; }
}