:root {
  --ink: #17263a;
  --ink-soft: #5f6875;
  --forest: #1c2e49;
  --forest-deep: #122238;
  --copper: #c47c55;
  --gold: #e8b77f;
  --cream: #eee5d8;
  --paper: #fcf9f4;
  --line: #dedbd5;
  --error: #a93e36;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(390px, 46%) 1fr;
  background:
    linear-gradient(90deg, rgba(20, 30, 47, .16), rgba(255, 255, 255, .03)),
    url("/assets/20260914/portal-background-v2.png") center / cover no-repeat;
}

.welcome-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: clamp(32px, 5vw, 72px);
  color: #f7f7ef;
  background: linear-gradient(100deg, rgba(13, 26, 45, .92) 0%, rgba(17, 32, 53, .84) 62%, rgba(23, 38, 58, .66) 100%);
  isolation: isolate;
}

.welcome-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M0 20h40M20 0v40' stroke='%23fff' stroke-width='.5'/%3E%3C/svg%3E");
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.ambient { display: none; position: absolute; z-index: -1; border-radius: 50%; filter: blur(2px); }
.ambient-one { width: 380px; height: 380px; right: -180px; top: 10%; border: 1px solid rgba(217,238,167,.22); box-shadow: inset 0 0 80px rgba(158,215,187,.05); }
.ambient-two { width: 220px; height: 220px; left: -130px; bottom: 8%; background: rgba(217,238,167,.07); }

.back-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.74);
  font-size: 14px;
  text-decoration: none;
  transition: color .2s, transform .2s;
}

.back-link:hover { color: #fff; transform: translateX(-2px); }
.back-link svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.welcome-copy { margin: auto 0; max-width: 600px; padding: 64px 0; }
.eyebrow, .section-label, .dialog-kicker { margin: 0 0 18px; font-size: 11px; font-weight: 700; letter-spacing: .22em; }
.eyebrow { color: var(--gold); }

.welcome-copy h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(48px, 5.1vw, 80px);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.045em;
}

.welcome-copy h1 em { color: var(--gold); font-weight: inherit; }
.intro { max-width: 450px; margin: 30px 0 0; color: rgba(255,255,255,.68); font-size: 16px; line-height: 1.75; }

.progress-card {
  max-width: 480px;
  padding: 19px 22px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 15px;
  background: rgba(4,33,32,.34);
  box-shadow: 0 18px 40px rgba(0,0,0,.09);
  backdrop-filter: blur(12px);
}

.progress-topline, .progress-caption { display: flex; justify-content: space-between; align-items: center; }
.progress-topline { font-size: 13px; }
.progress-topline span { color: rgba(255,255,255,.7); }
.progress-topline strong { color: var(--gold); font-size: 14px; }
.progress-track { height: 5px; margin: 14px 0; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.12); }
.progress-track span { display: block; width: 72%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--copper), var(--gold)); }
.progress-caption { color: rgba(255,255,255,.52); font-size: 11px; }
.progress-caption i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--copper); }

.login-panel {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 48px 28px;
  background: rgba(241, 239, 230, .38);
  backdrop-filter: blur(4px);
}
.login-wrap {
  width: min(100%, 526px);
  padding: clamp(36px, 4vw, 52px);
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 24px;
  background: rgba(252, 251, 247, .92);
  box-shadow: 0 28px 80px rgba(15, 46, 43, .2);
  backdrop-filter: blur(18px);
}
.mobile-accent { display: none; }
.section-label { color: #ad6743; }
.form-header h2 { margin: 0; font-family: "Fraunces", Georgia, serif; font-size: clamp(38px, 4vw, 52px); line-height: 1.05; letter-spacing: -.035em; }
.form-header > p:last-child { margin: 15px 0 36px; color: var(--ink-soft); line-height: 1.65; }

.field-group { margin-bottom: 22px; }
.field-group label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.label-row label { margin-bottom: 9px; }
.text-button { margin: 0 0 9px; padding: 0; border: 0; color: #9a5838; background: none; cursor: pointer; font-size: 12px; font-weight: 600; }
.text-button:hover { text-decoration: underline; }

.input-wrap { position: relative; }
.input-wrap > svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 19px;
  transform: translateY(-50%);
  fill: none;
  stroke: #879592;
  stroke-width: 1.55;
}

.input-wrap input {
  width: 100%;
  height: 56px;
  padding: 0 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.input-wrap input::placeholder { color: #a4aeac; }
.input-wrap input:hover { border-color: #bdc9c4; }
.input-wrap input:focus { border-color: #b66f49; box-shadow: 0 0 0 4px rgba(182,111,73,.12); }
.field-group.has-error input { border-color: var(--error); background: #fffafa; }
.field-error { min-height: 16px; margin: 5px 2px -5px; color: var(--error); font-size: 11px; }

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  color: #7b8986;
  background: transparent;
  cursor: pointer;
}
.password-toggle:hover { color: var(--ink); background: #f0f3f1; }
.password-toggle svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }

.remember-row { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 26px; color: var(--ink-soft); cursor: pointer; font-size: 13px; }
.remember-row input { position: absolute; opacity: 0; }
.checkmark { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid #bcc8c3; border-radius: 5px; background: #fff; transition: .2s; }
.checkmark svg { width: 11px; fill: none; stroke: white; stroke-width: 2; opacity: 0; }
.remember-row input:checked + .checkmark { border-color: var(--forest); background: var(--forest); }
.remember-row input:checked + .checkmark svg { opacity: 1; }
.remember-row input:focus-visible + .checkmark { box-shadow: 0 0 0 3px rgba(182,111,73,.17); }

.submit-button, .create-button, .dialog-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 55px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s, background .18s;
}

.submit-button { gap: 11px; border: 0; color: white; background: var(--forest); box-shadow: 0 12px 28px rgba(19,35,58,.18); }
.submit-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .18s; }
.submit-button:hover { transform: translateY(-1px); background: var(--forest-deep); box-shadow: 0 15px 32px rgba(19,35,58,.24); }
.submit-button:hover svg { transform: translateX(3px); }
.submit-button:disabled { opacity: .7; cursor: wait; }
.form-status { min-height: 18px; margin: 8px 0 -2px; color: #9a5838; text-align: center; font-size: 12px; }

.divider { display: flex; align-items: center; gap: 14px; margin: 26px 0 18px; color: #889490; font-size: 11px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.create-button { border: 1px solid #cbd4d0; color: var(--ink); background: transparent; font-size: 14px; }
.create-button:hover { border-color: #93a49d; background: #f3f5f2; transform: translateY(-1px); }

.form-footer { display: flex; justify-content: center; gap: 10px; margin-top: 32px; color: #9aa5a2; font-size: 11px; }
.form-footer a, .form-footer button { padding: 0; border: 0; color: inherit; background: none; text-decoration: none; cursor: pointer; }
.form-footer a:hover, .form-footer button:hover { color: var(--ink); }

dialog {
  width: min(calc(100% - 32px), 430px);
  padding: 36px;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 90px rgba(13,26,45,.3);
}
dialog::backdrop { background: rgba(13,26,45,.56); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 15px; right: 17px; border: 0; color: #7d8a87; background: none; cursor: pointer; font-size: 26px; }
.dialog-kicker { color: #ad6743; }
dialog h3 { margin: 0 0 12px; font-family: "Fraunces", Georgia, serif; font-size: 30px; }
dialog p:not(.dialog-kicker) { color: var(--ink-soft); line-height: 1.65; }
.dialog-action { height: 49px; margin-top: 25px; border: 0; color: #fff; background: var(--forest); font-size: 13px; }

@media (max-width: 820px) {
  .page-shell { display: block; }
  .welcome-panel { display: none; }
  .page-shell { background-position: 32% center; }
  .login-panel { min-height: 100svh; padding: 34px 22px; background: rgba(18, 32, 54, .34); backdrop-filter: blur(3px); }
  .login-wrap { position: relative; width: min(100%, 430px); padding: 38px 26px 28px; border: 1px solid rgba(255,255,255,.6); border-radius: 22px; background: rgba(252,249,244,.93); box-shadow: 0 20px 70px rgba(18,32,54,.22); backdrop-filter: blur(14px); }
  .mobile-accent { display: block; width: 42px; height: 5px; margin-bottom: 32px; border-radius: 99px; background: var(--copper); }
  .form-header > p:last-child { margin-bottom: 30px; }
}

/* Registration page */
.register-shell { grid-template-columns: minmax(330px, 35%) 1fr; }
.register-shell .welcome-panel { background: linear-gradient(105deg, rgba(13,26,45,.94), rgba(17,32,53,.76)); }
.register-shell .welcome-copy { padding-bottom: 28px; }
.register-shell .welcome-copy h1 { font-size: clamp(44px, 4.2vw, 68px); }
.register-note {
  max-width: 430px;
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  color: rgba(255,255,255,.7);
  background: rgba(12,25,43,.48);
  font-size: 12px;
  line-height: 1.6;
  backdrop-filter: blur(10px);
}
.register-note strong { display: block; margin-bottom: 4px; color: #f5d2a8; font-size: 13px; }

.register-panel {
  min-height: 100vh;
  padding: 34px clamp(24px, 4vw, 60px);
  overflow: auto;
  background: rgba(238,229,216,.34);
  backdrop-filter: blur(4px);
}
.register-card {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: clamp(34px, 4vw, 52px);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 24px;
  background: rgba(252,249,244,.94);
  box-shadow: 0 28px 80px rgba(16,31,53,.2);
  backdrop-filter: blur(18px);
}
.register-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.register-header h2 { margin: 0; font-family: "Fraunces", Georgia, serif; font-size: clamp(34px, 3.4vw, 48px); letter-spacing: -.035em; line-height: 1.05; }
.register-header p:last-child { margin: 10px 0 0; color: var(--ink-soft); font-size: 14px; }
.signin-link { flex: 0 0 auto; margin-top: 5px; color: #955534; font-size: 13px; font-weight: 700; text-decoration: none; }
.signin-link:hover { text-decoration: underline; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .field-group { margin: 0; }
.form-grid .full-width { grid-column: 1 / -1; }
.choice-label, .select-label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.plain-input, .select-input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: rgba(255,255,255,.86);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.plain-input::placeholder { color: #a7aaae; }
.plain-input:focus, .select-input:focus { border-color: #b66f49; box-shadow: 0 0 0 4px rgba(182,111,73,.12); }
.choice-row { display: flex; gap: 10px; }
.choice-pill { flex: 1; }
.choice-pill input { position: absolute; opacity: 0; }
.choice-pill span { display: grid; place-items: center; height: 52px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.86); color: var(--ink-soft); cursor: pointer; font-size: 13px; transition: .2s; }
.choice-pill input:checked + span { border-color: #a7603e; color: #8c492a; background: #fbede2; box-shadow: inset 0 0 0 1px #a7603e; }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.code-button { padding: 0 18px; border: 1px solid #b98265; border-radius: 11px; color: #8c492a; background: #fff8f1; cursor: pointer; font-size: 12px; font-weight: 700; white-space: nowrap; }
.code-button:hover { background: #faeadc; }
.terms-row { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 9px; margin-top: 3px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.terms-row input { margin-top: 3px; accent-color: #1c2e49; }
.terms-row a { color: #955534; }
.register-submit { grid-column: 1 / -1; margin-top: 2px; }
.register-status { grid-column: 1 / -1; min-height: 16px; margin: -7px 0 0; color: #9a5838; text-align: center; font-size: 12px; }

@media (max-width: 920px) {
  .register-shell { display: block; }
  .register-shell .welcome-panel { display: none; }
  .register-panel { padding: 26px 18px; background: rgba(20,30,47,.38); }
}

@media (max-width: 620px) {
  .register-panel { padding: 16px 12px; }
  .register-card { padding: 30px 20px; border-radius: 20px; }
  .register-header { display: block; }
  .signin-link { display: inline-block; margin-top: 13px; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .form-grid .full-width, .terms-row, .register-submit, .register-status { grid-column: 1; }
}

@media (max-width: 420px) {
  .login-panel { padding: 18px 14px; }
  .login-wrap { padding: 30px 20px 24px; }
  .form-header h2 { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
