:root {
  --bg-dark-emerald: #061712;
  --bg-deep-forest: #0b221a;
  --gold-primary: #d4a359;
  --gold-light: #f3dfb5;
  --card-cream: #faf8f3;
  --text-muted: #8b9a93;
  --text-dark: #1b2621;
  --danger: #b3261e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 20%, #0d2e23 0%, #061712 60%, #030a08 100%);
  color: #e5ece9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(20, 84, 61, 0.3) 0%, transparent 70%);
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}

.brand-header { z-index: 1; text-align: center; margin-bottom: 2rem; }
.brand-eyebrow { font-size: .72rem; letter-spacing: .35em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: .4rem; }
.brand-title { font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; color: #fff; }
.brand-title .gold-accent { color: var(--gold-primary); font-family: 'Playfair Display', serif; font-style: italic; font-weight: 400; }

.auth-container {
  position: relative;
  width: 100%;
  max-width: 960px;
  min-height: 690px;
  border-radius: 28px;
  background: var(--card-cream);
  box-shadow: 0 35px 80px -15px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.08);
  overflow: hidden;
  z-index: 10;
  display: flex;
}

.form-wrapper {
  position: absolute;
  top: 0;
  width: 55%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 3.5rem;
  transition: all .75s cubic-bezier(.65, 0, .35, 1);
  z-index: 5;
}

.login-form-wrapper { left: 0; opacity: 1; pointer-events: all; }
.register-form-wrapper { right: 0; opacity: 0; pointer-events: none; transform: translateX(40px); }

.auth-container.signup-mode .login-form-wrapper { opacity: 0; pointer-events: none; transform: translateX(-40px); }
.auth-container.signup-mode .register-form-wrapper { opacity: 1; pointer-events: all; transform: translateX(0); }

.form-title { font-size: 1.85rem; font-weight: 700; color: var(--text-dark); position: relative; margin-bottom: 2rem; display: inline-block; align-self: flex-start; }
.form-title::after { content: ""; position: absolute; bottom: -6px; left: 0; width: 42px; height: 3px; background: var(--gold-primary); border-radius: 2px; }

.referral-note { font-size: .82rem; color: #9f7535; margin: -1rem 0 1.2rem; }

.form-group-custom { margin-bottom: 1.45rem; }
.input-wrap { position: relative; }

.form-control-custom {
  width: 100%;
  padding: .75rem 2.4rem .75rem .2rem;
  border: none;
  border-bottom: 1.5px solid #d8dfdb;
  background: transparent;
  font-size: .95rem;
  color: #172720;
  transition: all .25s ease;
  border-radius: 0;
}
.form-control-custom:focus { outline: none; border-bottom-color: var(--bg-deep-forest); box-shadow: 0 1px 0 0 var(--bg-deep-forest); }
.form-control-custom::placeholder { color: #8c9b94; font-weight: 400; }
.form-control-custom.is-invalid { border-bottom-color: var(--danger); }

.form-icon { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); color: #798d84; font-size: 1.05rem; pointer-events: none; transition: color .2s; }

button.password-toggle { background: none; border: 0; padding: 0; line-height: 1; cursor: pointer; pointer-events: all; }
button.password-toggle:hover, button.password-toggle:focus-visible { color: var(--bg-deep-forest); outline: none; }

.field-error { display: block; margin-top: .35rem; font-size: .78rem; color: var(--danger); }

.form-check-input:checked { background-color: var(--bg-deep-forest); border-color: var(--bg-deep-forest); }
.form-check-input:focus { border-color: var(--bg-deep-forest); box-shadow: 0 0 0 .2rem rgba(11,34,26,.15); }

.form-link { color: #9f7535; text-decoration: none; font-weight: 600; font-size: .88rem; transition: color .2s; }
.form-link:hover { color: #704e1c; text-decoration: underline; }

.btn-emerald {
  background: linear-gradient(135deg, #0e3527 0%, #061912 100%);
  color: var(--gold-light);
  border: 1px solid rgba(212,163,89,.25);
  border-radius: 999px;
  padding: .85rem 1.75rem;
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: .03em;
  transition: all .3s ease;
  box-shadow: 0 8px 20px -4px rgba(6,23,18,.45);
  width: 100%;
}
.btn-emerald:hover { background: linear-gradient(135deg, #154c38 0%, #0a271d 100%); color: #fff; transform: translateY(-1px); box-shadow: 0 12px 24px -5px rgba(6,23,18,.55); border-color: var(--gold-primary); }
.btn-emerald:active { transform: translateY(1px); }
.btn-emerald:disabled { opacity: .7; cursor: wait; }

/* ---- Sliding blade overlay ---- */
.blade-overlay {
  position: absolute;
  top: 0;
  left: 55%;
  width: 45%;
  height: 100%;
  background: linear-gradient(145deg, #0f3d2e 0%, #071f16 55%, #04120d 100%);
  z-index: 20;
  overflow: hidden;
  transition: transform .85s cubic-bezier(.77, 0, .175, 1);
  transform-origin: center;
  color: #fff;
}
.blade-overlay::before {
  content: "";
  position: absolute;
  top: -10%;
  left: -40px;
  width: 80px;
  height: 120%;
  background: linear-gradient(90deg, rgba(212,163,89,.35) 0%, rgba(212,163,89,0) 100%);
  transform: rotate(6.5deg);
  pointer-events: none;
  filter: blur(4px);
  transition: all .85s ease;
}
.blade-shape {
  position: absolute;
  inset: 0;
  clip-path: polygon(14% 0%, 100% 0%, 100% 100%, 0% 100%);
  background: linear-gradient(140deg, #124634 0%, #09261c 50%, #05140e 100%);
  transition: clip-path .85s cubic-bezier(.77, 0, .175, 1);
}
.blade-shape::after {
  content: "";
  position: absolute;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,163,89,.12) 0%, transparent 65%);
  top: 15%;
  right: -100px;
  pointer-events: none;
}

.auth-container.signup-mode .blade-overlay { transform: translateX(-122.3%); }
.auth-container.signup-mode .blade-shape { clip-path: polygon(0% 0%, 86% 0%, 100% 100%, 0% 100%); }
.auth-container.signup-mode .blade-overlay::before { left: auto; right: -40px; transform: rotate(-6.5deg); background: linear-gradient(-90deg, rgba(212,163,89,.35) 0%, rgba(212,163,89,0) 100%); }

.blade-content-container { position: relative; width: 100%; height: 100%; z-index: 25; padding: 4rem 3.5rem; display: flex; flex-direction: column; justify-content: center; }
.blade-pane { position: absolute; left: 3.5rem; right: 3rem; transition: opacity .45s ease, transform .6s ease; }

.blade-pane-login { opacity: 1; transform: translateX(0); pointer-events: all; }
.auth-container.signup-mode .blade-pane-login { opacity: 0; transform: translateX(35px); pointer-events: none; }
.blade-pane-register { opacity: 0; transform: translateX(-35px); pointer-events: none; }
.auth-container.signup-mode .blade-pane-register { opacity: 1; transform: translateX(0); pointer-events: all; }

.brand-tag { font-family: 'Cinzel', serif; letter-spacing: .3em; font-size: .75rem; color: var(--gold-primary); text-transform: uppercase; margin-bottom: 1.25rem; display: inline-flex; align-items: center; gap: .5rem; }
.brand-tag::after { content: ""; width: 28px; height: 1px; background: var(--gold-primary); opacity: .6; }

.blade-heading { font-family: 'Playfair Display', serif; font-size: 2.85rem; line-height: 1.12; color: #fff; font-weight: 500; margin-bottom: 1.25rem; }
.blade-heading em { font-style: italic; color: var(--gold-light); display: block; font-weight: 400; }
.blade-desc { font-size: .95rem; line-height: 1.65; color: #9cb3a9; margin-bottom: 2rem; max-width: 320px; }

.btn-blade-toggle {
  border: 1px solid rgba(212,163,89,.45);
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(6px);
  color: #fbf7ee;
  padding: .65rem 1.6rem;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .05em;
  transition: all .25s ease;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  width: fit-content;
  text-decoration: none;
}
.btn-blade-toggle:hover { background: var(--gold-primary); color: var(--bg-dark-emerald); border-color: var(--gold-primary); transform: translateX(4px); }

.luxury-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  max-width: 340px;
  background: #09241b;
  border-left: 4px solid var(--gold-primary);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  box-shadow: 0 15px 30px rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  gap: .85rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all .4s cubic-bezier(.175, .885, .32, 1.275);
  z-index: 1000;
}
.luxury-toast.show { transform: translateY(0); opacity: 1; }

.system-footer { margin-top: 1.8rem; font-size: .78rem; color: #556c62; text-align: center; z-index: 2; }

@media (max-width: 900px) {
  .auth-container { flex-direction: column; min-height: auto; max-width: 480px; }
  .form-wrapper { position: relative; width: 100%; padding: 2.5rem 2rem; transform: none !important; }
  .login-form-wrapper { display: block; }
  .register-form-wrapper { display: none; }
  .auth-container.signup-mode .login-form-wrapper { display: none; }
  .auth-container.signup-mode .register-form-wrapper { display: block; opacity: 1; pointer-events: all; }
  .blade-overlay { position: relative; left: 0; width: 100%; height: auto; padding: 2.5rem 2rem; order: -1; transform: none !important; }
  .blade-shape { clip-path: none !important; }
  .blade-overlay::before { display: none; }
  .blade-content-container { padding: 0; }
  .blade-pane { position: relative; left: 0; right: 0; }
  .blade-heading { font-size: 2.2rem; }
}
