:root {
  --navy: #10294a;
  --navy-deep: #0b1f38;
  --cream: #f7f3ea;
  --card: #fbf8f1;
  --ink: #1b2733;
  --muted: #5e6b78;
  --gold: #b4892b;
  --gold-bright: #c9a03a;
  --rule: #e5dcc9;
  --slate: #9fb0c2;
  --error: #a3312a;
  --display: "Playfair Display", Georgia, serif;
  --body: "Source Serif 4", Georgia, serif;
  --ui: "Inter", system-ui, -apple-system, sans-serif;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}

a {
  color: var(--navy);
}
a:hover {
  color: var(--gold);
}

.auth-page {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

/* ----- Left: brand panel ----- */
.panel {
  background: var(--navy);
  color: var(--cream);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.panel::after {
  /* stepped squares motif from the logo */
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 320px;
  height: 320px;
  opacity: 0.08;
  background:
    linear-gradient(var(--cream), var(--cream)) 0 192px/96px 96px no-repeat,
    linear-gradient(var(--cream), var(--cream)) 104px 96px/96px 96px no-repeat,
    linear-gradient(var(--cream), var(--cream)) 208px 0/96px 96px no-repeat;
}
.panel .brand svg {
  width: 240px;
  height: auto;
  display: block;
}
.panel-body {
  margin-top: auto;
  margin-bottom: auto;
  padding: 48px 0;
  max-width: 30rem;
  position: relative;
  z-index: 1;
}
.eyebrow {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin: 0 0 16px;
}
.panel h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.2;
  margin: 0 0 18px;
}
.panel p.lede {
  color: #c9d3de;
  margin: 0 0 36px;
  font-family: var(--body);
  font-size: 17px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid rgba(247, 243, 234, 0.18);
  padding-top: 22px;
  margin: 0;
}
.stats div {
  padding-right: 12px;
}
.stats dt {
  font-family: var(--display);
  font-size: 28px;
  color: var(--cream);
  line-height: 1.1;
}
.stats dd {
  margin: 4px 0 0;
  font-family: var(--ui);
  font-size: 12px;
  color: var(--slate);
  letter-spacing: 0.02em;
}
.panel-foot {
  font-family: var(--ui);
  font-size: 12px;
  color: var(--slate);
  position: relative;
  z-index: 1;
}
.panel-foot a {
  color: var(--slate);
}

/* ----- Right: form ----- */
.auth-main {
  display: flex;
  flex-direction: column;
  padding: 32px 56px;
  background: var(--cream);

}
.topbar {
  display: flex;
  justify-content: flex-end;
  font-family: var(--ui);
  font-size: 14px;
}
.topbar a {
  text-decoration: none;
  color: var(--muted);
}
.topbar a:hover {
  color: var(--navy);
}
.form-wrap {
  margin: auto 0;
  width: 100%;
  max-width: 420px;
  align-self: center;
  padding: 40px 0;
}
.mobile-brand {
  display: none;
  margin-bottom: 28px;
}
.mobile-brand svg {
  width: 220px;
  height: auto;
}
.product {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 10px;
}
h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 8px;
}
.sub {
  color: var(--muted);
  margin: 0 0 32px;
}

.field {
  margin-bottom: 20px;
}
label {
  display: block;
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 7px;
}
.input {
  position: relative;
}
input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: 16px var(--ui);
  color: var(--ink);
  background: #fff;
  border: 1px solid #d6ccb6;
  border-radius: 4px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(16, 41, 74, 0.12);
}
input[aria-invalid="true"] {
  border-color: var(--error);
}
.input input {
  padding-right: 48px;
}
.toggle {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.toggle:hover {
  color: var(--navy);
}
.toggle:focus-visible {
  outline: 2px solid var(--navy);
}
.toggle .off {
  display: none;
}
.toggle[aria-pressed="true"] .on {
  display: none;
}
.toggle[aria-pressed="true"] .off {
  display: block;
}
.field-msg {
  font-family: var(--ui);
  font-size: 13px;
  color: var(--error);
  margin-top: 6px;
  min-height: 0;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -4px 0 24px;
  font-family: var(--ui);
  font-size: 14px;
}
.row a {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.row a:hover {
  color: var(--gold);
  border-color: var(--gold);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 400;
  color: var(--muted);
  cursor: pointer;
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--navy);
  margin: 0;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  border-radius: 3px;
  font: 600 15px var(--ui);
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.btn-primary {
  background: var(--gold);
  color: #fff;
  border: 1px solid var(--gold);
}
.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}
.btn-primary:disabled {
  opacity: 0.7;
  cursor: progress;
}
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
}
.btn-secondary:hover {
  background: var(--navy);
  color: var(--cream);
}
.btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.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;
  display: none;
}
.is-loading .spinner {
  display: block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.alert {
  display: none;
  font-family: var(--ui);
  font-size: 14px;
  background: #f6e7e4;
  color: var(--error);
  border-left: 3px solid var(--error);
  padding: 10px 14px;
  margin-bottom: 20px;
  border-radius: 2px;
}
.alert.is-visible {
  display: block;
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 30px 0 20px;
  font-family: var(--ui);
  font-size: 13px;
  color: var(--muted);
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.stack {
  display: grid;
  gap: 12px;
}

.terms {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.terms h3 {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 8px;
}
.terms p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.alert-form{
  padding: 10px 14px;
  margin-bottom: 10px;
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .panel {
    display: none;
  }
  .auth-main {
    padding: 20px 16px;
  }
  .mobile-brand {
    display: block;
  }
  .form-wrap {
    padding: 24px 0 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
