:root {
  --gold: #c9973f;
  --gold-deep: #a87a2c;
  --ink: #14201a;
  --ink-soft: #4b564f;
  --line: #e7e3da;
  --panel: #ffffff;
  --bg-tint: #fbfaf7;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-tint);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 900px 480px at 15% -8%, rgba(201, 151, 63, 0.10), transparent 60%),
    radial-gradient(ellipse 800px 520px at 105% 15%, rgba(20, 32, 26, 0.05), transparent 55%),
    var(--bg-tint);
}

a { color: inherit; text-decoration: none; }

/* ---------- BRAND HEADER ---------- */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 44px 0 28px;
}

.auth-brand .brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(201, 151, 63, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--gold-deep);
  flex-shrink: 0;
}

.auth-brand .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand .brand-name { font-family: var(--sans); font-weight: 700; font-size: 0.92rem; letter-spacing: 0.03em; color: var(--ink); }
.auth-brand .brand-sub { font-family: var(--sans); font-weight: 600; font-size: 0.66rem; letter-spacing: 0.14em; color: var(--gold-deep); }

/* ---------- CARD ---------- */
.auth-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 20px 60px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(20, 32, 26, 0.08);
  padding: 40px 36px 36px;
}

.auth-arc {
  width: 64px;
  height: 32px;
  margin: 0 0 20px;
  border: 2px solid var(--gold);
  border-bottom: none;
  border-radius: 100px 100px 0 0;
  opacity: 0.8;
}

.auth-heading {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--ink);
}

.auth-heading .gold-italic {
  color: var(--gold-deep);
  font-style: italic;
}

.auth-subtext {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 0 0 28px;
}

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

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

.field label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.field input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.94rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 151, 63, 0.14);
}

.field-error {
  font-size: 0.78rem;
  color: #b3441f;
  min-height: 0;
}

/* ---------- PASSWORD SHOW/HIDE ---------- */
.field-password { position: relative; }

.field-password input { padding-right: 46px; }

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

.toggle-password:hover { color: var(--ink); background: var(--bg-tint); }

.toggle-password .icon-eye-off { display: none; }
.toggle-password.is-visible .icon-eye { display: none; }
.toggle-password.is-visible .icon-eye-off { display: block; }

/* ---------- FORGOT PASSWORD LINK ---------- */
.forgot-link {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--gold-deep);
}

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

.forgot-link-below {
  align-self: flex-end;
  margin-top: 2px;
}

/* ---------- OTP INPUT ---------- */
.otp-input {
  letter-spacing: 0.5em;
  font-size: 1.15rem;
  text-align: center;
  font-weight: 700;
}

.step-hint {
  font-size: 0.84rem;
  color: var(--ink-soft);
  margin: -8px 0 4px;
}

.resend-row {
  text-align: center;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.resend-row button {
  background: none;
  border: none;
  color: var(--gold-deep);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

.resend-row button:hover { text-decoration: underline; }
.resend-row button:disabled { color: var(--ink-soft); cursor: default; text-decoration: none; }

.form-msg {
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: 10px;
  display: none;
}

.form-msg.show { display: block; }
.form-msg.error { background: #fdecec; color: #a3341a; }
.form-msg.success { background: #e9f5ec; color: #1f7a3f; }
.form-msg.info { background: #fbf3e2; color: #8a5a12; }

.form-msg a { text-decoration: underline; font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:disabled { opacity: 0.65; cursor: default; transform: none !important; }

.btn-gold {
  background: linear-gradient(135deg, #ddb267, var(--gold));
  color: #1c1305;
  box-shadow: 0 8px 22px rgba(201, 151, 63, 0.28);
  margin-top: 6px;
}

.btn-gold:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(201, 151, 63, 0.36);
}

.btn-google {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-google:hover:not(:disabled) {
  border-color: #d6d1c4;
  box-shadow: 0 4px 14px rgba(20, 32, 26, 0.08);
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-switch {
  margin-top: 26px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.auth-switch a {
  color: var(--gold-deep);
  font-weight: 700;
}

.auth-switch a:hover { text-decoration: underline; }

.back-home {
  position: fixed;
  top: 24px;
  left: 24px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.back-home:hover { color: var(--ink); }

@media (max-width: 480px) {
  .auth-card { padding: 32px 22px 28px; }
  .back-home { position: static; margin: 20px 0 -8px; }
}
