:root {
  color-scheme: light;
  --paper: #f6f2ea;
  --paper-deep: #ede7dc;
  --surface: #fffdf8;
  --ink: #241f1a;
  --ink-soft: #655e55;
  --line: #d8d0c4;
  --accent: #ff9500;
  --accent-ink: #a44a00;
  --accent-pale: #fff0d6;
  --charcoal: #1f1d1a;
  --danger: #8d2d2b;
  --danger-pale: #f7e5e1;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper-deep);
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

.auth-page {
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(18px, 3.5vw, 54px);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--paper-deep);
  background-size: 72px 72px;
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI Variable", "Helvetica Neue", sans-serif;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  width: min(1180px, 100%);
  min-height: min(760px, calc(100svh - clamp(36px, 7vw, 108px)));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--charcoal) 28%, var(--line));
  border-radius: 10px;
  background: var(--surface);
}

.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(34px, 5vw, 72px);
  overflow: hidden;
  background: var(--charcoal);
  color: #fff8ed;
}

.auth-story::before,
.auth-story::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.auth-story::before {
  top: clamp(118px, 19vh, 176px);
  right: -90px;
  width: min(34vw, 420px);
  height: min(34vw, 420px);
  border: 1px solid color-mix(in srgb, #fff8ed 28%, transparent);
  border-radius: 50%;
}

.auth-story::after {
  top: clamp(168px, 26vh, 236px);
  right: -22px;
  width: min(23vw, 278px);
  height: min(23vw, 278px);
  border: 1px solid color-mix(in srgb, var(--accent) 72%, transparent);
  border-radius: 50%;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: #fff8ed;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.auth-mark {
  display: grid;
  gap: 3px;
  width: 31px;
  height: 31px;
  padding: 7px 6px;
  border: 1px solid color-mix(in srgb, #fff8ed 46%, transparent);
  border-radius: 6px;
}

.auth-mark i {
  display: block;
  height: 2px;
  background: #fff8ed;
}

.auth-mark i:nth-child(2) {
  width: 70%;
}

.auth-mark i:nth-child(3) {
  width: 42%;
  background: var(--accent);
}

.auth-story-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 510px);
  margin: auto 0;
  padding: clamp(74px, 11vh, 126px) 0 clamp(64px, 9vh, 106px);
}

.auth-eyebrow,
.secure-label,
.auth-footnote {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-eyebrow {
  margin: 0 0 20px;
  color: #d8c5ab;
  font-size: 0.73rem;
  font-weight: 700;
}

.auth-story-copy h2 {
  margin: 0;
  max-width: 10ch;
  color: #fff8ed;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.55rem, 5vw, 4.85rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.auth-story-copy > p:last-child {
  max-width: 48ch;
  margin: 28px 0 0;
  color: #d8cfc1;
  font-size: clamp(0.98rem, 1.4vw, 1.08rem);
  line-height: 1.75;
}

.auth-capabilities {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 22px 0 0;
  border-top: 1px solid color-mix(in srgb, #fff8ed 24%, transparent);
  list-style: none;
}

.auth-capabilities li {
  color: #e5ddd0;
  font-size: 0.78rem;
  line-height: 1.5;
}

.auth-capabilities span {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.auth-entry {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(34px, 5vw, 70px);
  background: var(--surface);
}

.auth-entry-inner {
  width: min(100%, 420px);
  margin: auto;
}

.secure-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 26px;
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 750;
}

.secure-label span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-pale);
}

.auth-heading h1 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 4.5vw, 3.55rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
}

.auth-heading p {
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.auth-error {
  margin: 26px 0 -4px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 38%, var(--line));
  border-radius: 6px;
  background: var(--danger-pale);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-form {
  display: grid;
  gap: 22px;
  margin-top: 36px;
}

.auth-field {
  display: grid;
  gap: 9px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: #f8faf6;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  transition:
    border-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-field input::placeholder {
  color: #89958f;
}

.auth-field input:hover {
  border-color: #a5b7ae;
  background: var(--surface);
}

.auth-field input:focus-visible {
  border-color: var(--accent-ink);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-pale);
}

.auth-field input[aria-invalid="true"] {
  border-color: color-mix(in srgb, var(--danger) 64%, var(--line));
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin-top: 4px;
  padding: 13px 17px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-submit span:last-child {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-submit:hover {
  background: #e98500;
  transform: translateY(-1px);
}

.auth-submit:hover span:last-child {
  transform: translateX(3px);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-submit:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, #fff8ed);
  outline-offset: 3px;
}

.auth-help {
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.6;
  text-align: center;
}

.auth-footnote {
  margin: auto auto 0;
  padding-top: 48px;
  color: #7b8983;
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 900px) {
  .auth-page {
    padding: 18px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    min-height: calc(100svh - 36px);
  }

  .auth-story {
    min-height: auto;
    padding: 28px;
  }

  .auth-story::before,
  .auth-story::after,
  .auth-story-copy > p:last-child,
  .auth-capabilities {
    display: none;
  }

  .auth-story-copy {
    margin: 0;
    padding: 44px 0 4px;
  }

  .auth-story-copy h2 {
    max-width: 15ch;
    font-size: clamp(2.2rem, 9vw, 3.65rem);
  }

  .auth-entry {
    padding: clamp(36px, 8vw, 64px) clamp(24px, 8vw, 72px) 26px;
  }
}

@media (max-width: 520px) {
  .auth-page {
    padding: 0;
    background: var(--surface);
  }

  .auth-layout {
    min-height: 100svh;
    border: 0;
    border-radius: 0;
  }

  .auth-story {
    padding: 22px 22px 26px;
  }

  .auth-story-copy {
    padding-top: 38px;
  }

  .auth-story-copy h2 {
    max-width: 12ch;
    font-size: clamp(2.15rem, 12vw, 3rem);
  }

  .auth-entry {
    padding: 38px 22px 24px;
  }

  .secure-label {
    margin-bottom: 22px;
  }

  .auth-form {
    margin-top: 30px;
  }

  .auth-footnote {
    padding-top: 42px;
  }
}

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