:root {
  color-scheme: light;
  --page: #e8ebe2;
  --paper: #f8f7f1;
  --paper-strong: #fffefa;
  --ink: #18231c;
  --muted: #5f6a62;
  --line: #d8ddd3;
  --field-border: #7d877c;
  --forest: #294b3b;
  --forest-dark: #183226;
  --forest-soft: #dce6dc;
  --terracotta: #b64732;
  --terracotta-dark: #963825;
  --danger: #a33325;
  --success: #286344;
  --focus: #d57955;
  --shadow: 0 28px 80px rgb(30 48 38 / 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 300px;
  background: var(--page);
}

body {
  min-width: 300px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: wait;
  opacity: 0.68;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 72%, transparent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  border-radius: 10px;
  background: var(--forest-dark);
  color: #fff;
  padding: 10px 14px;
  font-weight: 750;
}

.skip-link:focus {
  transform: translateY(0);
}

.auth-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(460px, 1.07fr) minmax(420px, 0.93fr);
}

.auth-story {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(28px, 4.2vw, 64px);
  background:
    radial-gradient(circle at 15% 10%, rgb(255 255 255 / 0.08), transparent 26%),
    var(--forest-dark);
  color: #f8f7f1;
}

.auth-story::after {
  position: absolute;
  right: -100px;
  bottom: -145px;
  width: 360px;
  height: 360px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 62px rgb(255 255 255 / 0.025),
    0 0 0 124px rgb(255 255 255 / 0.018);
  content: "";
  pointer-events: none;
}

.brand,
.panel-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand {
  position: relative;
  z-index: 1;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #f4efe2;
  color: var(--forest-dark);
  font-family: Georgia, serif;
  font-size: 24px;
  font-style: italic;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand small {
  color: rgb(248 247 241 / 0.65);
  font-size: 12px;
}

.story-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  margin: clamp(64px, 10vh, 118px) 0 clamp(38px, 7vh, 72px);
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--terracotta);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-story .eyebrow {
  color: #e7a08c;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 12ch;
  font-size: clamp(3.3rem, 5.7vw, 6.7rem);
  line-height: 0.97;
}

.story-copy > p:last-child {
  max-width: 57ch;
  margin: 24px 0 0;
  color: rgb(248 247 241 / 0.72);
  font-size: clamp(1rem, 1.3vw, 1.16rem);
}

.story-photo {
  position: relative;
  z-index: 1;
  width: min(100%, 780px);
  margin: auto 0 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.13);
  border-radius: 20px;
  background: #0d2017;
  box-shadow: 0 24px 48px rgb(0 0 0 / 0.22);
}

.story-photo img {
  display: block;
  width: 100%;
  height: clamp(190px, 24vw, 310px);
  object-fit: cover;
}

.story-photo figcaption {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  background: rgb(13 32 23 / 0.92);
  color: rgb(248 247 241 / 0.7);
  font-size: 13px;
}

.story-photo figcaption > span:first-child {
  color: #e7a08c;
}

.story-photo figcaption strong {
  color: #f8f7f1;
}

.auth-panel {
  display: grid;
  min-width: 0;
  min-height: 100dvh;
  place-items: center;
  padding: clamp(32px, 6vw, 88px);
  background:
    linear-gradient(rgb(255 255 255 / 0.2), transparent 45%),
    var(--paper);
}

.auth-card {
  width: min(100%, 470px);
}

.panel-brand {
  display: none;
  margin-bottom: 34px;
  color: var(--forest-dark);
}

.panel-brand .brand-mark {
  background: var(--forest);
  color: #fff;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: clamp(34px, 6vh, 64px);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #ecefe8;
}

.mode-switch button {
  min-height: 43px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.mode-switch button[aria-pressed="true"] {
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 3px 12px rgb(31 47 37 / 0.08);
}

.form-heading {
  margin-bottom: 28px;
}

h2 {
  color: var(--forest-dark);
  font-size: clamp(2.75rem, 5vw, 4.35rem);
  line-height: 0.98;
}

.form-heading > p:last-child {
  margin: 13px 0 0;
  color: var(--muted);
}

#auth-form {
  display: grid;
  gap: 17px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.field input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--field-border);
  border-radius: 11px;
  background: var(--paper-strong);
  padding: 0 15px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.field input:hover {
  border-color: #aeb8ac;
}

.field input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgb(41 75 59 / 0.1);
}

.field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.submit-button {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
  border: 1px solid var(--terracotta);
  border-radius: 11px;
  background: var(--terracotta);
  color: #fff;
  padding: 0 18px;
  font-weight: 800;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 120ms ease;
}

.submit-button:hover:not(:disabled) {
  border-color: var(--terracotta-dark);
  background: var(--terracotta-dark);
}

.submit-button:active:not(:disabled) {
  transform: translateY(1px);
}

.submit-button span {
  font-size: 21px;
}

.form-status {
  min-height: 1.5em;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.form-status[data-tone="error"] {
  color: var(--danger);
}

.form-status[data-tone="success"] {
  color: var(--success);
}

.form-actions {
  min-height: 27px;
  margin-top: 11px;
  text-align: center;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--forest);
  padding: 4px;
  font-size: 14px;
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: rgb(41 75 59 / 0.3);
  text-underline-offset: 4px;
}

.text-button:hover {
  color: var(--terracotta-dark);
}

.privacy-note {
  margin: 32px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding-top: 18px;
  font-size: 12px;
  text-align: center;
}

.legal-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 10px 0 0;
  font-size: 12px;
}

.legal-links a {
  color: var(--forest);
  font-weight: 650;
}

.consent-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.consent-field input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--forest);
}

.consent-field a {
  color: var(--forest);
  font-weight: 650;
}

@media (max-width: 940px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-story {
    min-height: auto;
    padding: 34px clamp(22px, 6vw, 56px) 48px;
  }

  .story-copy {
    margin: 58px 0 34px;
  }

  h1 {
    max-width: 15ch;
    font-size: clamp(3.15rem, 10vw, 5.8rem);
  }

  .story-photo {
    width: 100%;
  }

  .story-photo img {
    height: clamp(190px, 45vw, 340px);
  }

  .auth-panel {
    min-height: auto;
    padding: 64px clamp(22px, 8vw, 72px) 82px;
  }
}

@media (max-width: 620px) {
  .auth-story {
    display: none;
  }

  .auth-panel {
    min-height: 100dvh;
    place-items: start center;
    padding: 26px clamp(18px, 6vw, 34px) 48px;
  }

  .panel-brand {
    display: inline-flex;
  }

  .panel-brand .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .mode-switch {
    margin-bottom: 42px;
  }

  h2 {
    font-size: clamp(2.65rem, 14vw, 3.8rem);
  }

  .form-heading {
    margin-bottom: 24px;
  }
}

@media (max-width: 360px) {
  .auth-panel {
    padding-inline: 15px;
  }

  .panel-brand {
    margin-bottom: 25px;
  }

  .mode-switch {
    margin-bottom: 34px;
  }

  #auth-form {
    gap: 14px;
  }

  .field input,
  .submit-button {
    min-height: 51px;
  }
}

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