:root {
  color-scheme: light;
  --canvas: #f6f1e8;
  --surface: #fffdf9;
  --surface-soft: #eee5d8;
  --ink: #201d1a;
  --ink-soft: #5f5851;
  --ink-faint: #6c625a;
  --line: #d9cec1;
  --primary: #a94f34;
  --primary-hover: #8f3e29;
  --danger: #8f3030;
  --danger-soft: #f4dddd;
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid rgb(169 79 52 / 34%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

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

.login-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(360px, .92fr) minmax(440px, 1.08fr);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(28px, 5vw, 68px);
  background:
    radial-gradient(circle at 88% 11%, rgb(235 196 160 / 18%), transparent 26rem),
    linear-gradient(145deg, #2b2621 0%, #1e1b18 62%, #34281f 100%);
  color: #fffaf3;
}

.login-story::after {
  position: absolute;
  right: -18%;
  bottom: 11%;
  width: 58%;
  aspect-ratio: 1;
  border: 1px solid rgb(255 250 243 / 9%);
  border-radius: 50%;
  box-shadow:
    0 0 0 48px rgb(255 250 243 / 2.5%),
    0 0 0 96px rgb(255 250 243 / 1.7%);
  content: "";
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px 10px 3px;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

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

.brand strong {
  font-size: 14px;
  letter-spacing: .08em;
}

.brand small {
  margin-top: 1px;
  color: #cfc5bb;
  font-size: 10px;
}

.login-story__content {
  position: relative;
  z-index: 1;
  max-width: 610px;
  margin: auto 0;
  padding: 72px 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: #bd806b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.login-story h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(38px, 5.2vw, 72px);
  font-weight: 650;
  line-height: 1.01;
  letter-spacing: -.052em;
}

.login-story__content > p:last-child {
  max-width: 520px;
  margin: 24px 0 0;
  color: #d8cec4;
  font-size: clamp(15px, 1.5vw, 18px);
}

.login-story__note {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #cfc5bb;
  font-size: 12px;
}

.login-story__note span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #69a77e;
  box-shadow: 0 0 0 4px rgb(105 167 126 / 12%);
}

.login-panel {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: clamp(28px, 7vw, 92px);
  background:
    radial-gradient(circle at 100% 0, rgb(169 79 52 / 7%), transparent 25rem),
    var(--canvas);
}

.login-card {
  width: min(100%, 430px);
}

.login-card__heading {
  margin-bottom: 34px;
}

.login-card__heading .eyebrow {
  color: var(--primary);
}

.login-card h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 690;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.login-card__heading > p:last-child {
  margin: 13px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

#login-form {
  display: grid;
  gap: 20px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 750;
}

.password-control {
  position: relative;
}

.password-control input {
  width: 100%;
  min-height: 52px;
  padding: 12px 108px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.password-control input:hover {
  border-color: #bdad9e;
}

.password-control input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgb(169 79 52 / 13%);
}

.password-control input[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fffafa;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-height: 40px;
  padding: 0 10px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.password-toggle:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.field-hint {
  display: block;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 11px;
}

.login-error {
  padding: 11px 13px;
  border: 1px solid #dfbcbc;
  border-radius: 8px;
  background: var(--danger-soft);
  color: #712828;
  font-size: 12px;
}

.login-status {
  min-height: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.login-status:empty {
  display: none;
}

.submit-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--primary);
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 750;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

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

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

.submit-button:disabled {
  cursor: wait;
  opacity: .68;
}

.submit-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.privacy-note {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 11px;
}

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: auto;
    padding: 22px 20px 26px;
  }

  .login-story__content {
    padding: 44px 0 20px;
  }

  .login-story h1 {
    max-width: 520px;
    font-size: clamp(34px, 10vw, 50px);
  }

  .login-story__content > p:last-child {
    margin-top: 16px;
    font-size: 14px;
  }

  .login-story__note {
    display: none;
  }

  .login-panel {
    place-items: start center;
    padding: 38px 20px max(44px, env(safe-area-inset-bottom));
  }

  .login-card__heading {
    margin-bottom: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
