:root {
  --paper: hsl(38 38% 98%);
  --paper-deep: hsl(35 40% 96%);
  --ink: hsl(28 11% 12%);
  --ink-soft: hsl(30 6% 38%);
  --gold: hsl(33 54% 48%);
  --gold-dark: hsl(32 56% 40%);
  --gold-light: hsl(37 65% 72%);
  --line: hsl(34 38% 86%);
  --white: hsl(0 0% 100%);
  --danger: hsl(3 54% 46%);
  --success: hsl(145 34% 35%);
  --serif: "Italiana", "Times New Roman", serif;
  --script: "Parisienne", cursive;
  --sans: "Manrope", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-height: 88px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: light;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.login-header {
  position: fixed;
  z-index: 10;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding: 0 clamp(24px, 4vw, 64px);
  border-bottom: 1px solid hsl(34 38% 86% / 0.78);
  background: hsl(38 38% 98% / 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  line-height: 1;
}

.brand__mark {
  width: 43px;
  height: 43px;
  fill: none;
  stroke: var(--gold-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.brand__name {
  font-family: var(--serif);
  font-size: clamp(27px, 2.1vw, 36px);
  letter-spacing: -0.045em;
}

.brand__year {
  color: var(--gold-dark);
  font-family: var(--script);
  font-size: clamp(23px, 1.8vw, 31px);
  white-space: nowrap;
  transform: translateY(2px) rotate(-3deg);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  transition: color 200ms ease;
}

.back-link svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 220ms var(--ease);
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--gold-dark);
}

.back-link:hover svg,
.back-link:focus-visible svg {
  transform: translateX(-3px);
}

.login-main {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(540px, 1.1fr);
  min-height: 100vh;
  padding-top: var(--header-height);
}

.story-panel {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--header-height));
  overflow: hidden;
  padding: clamp(54px, 8vw, 120px);
  color: var(--white);
  background:
    radial-gradient(circle at 82% 18%, hsl(35 58% 64% / 0.2), transparent 30%),
    linear-gradient(145deg, hsl(29 18% 16%), hsl(28 13% 10%));
}

.story-panel::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(hsl(37 58% 73% / 0.17) 0.8px, transparent 0.8px);
  background-size: 17px 17px;
  content: "";
  mask-image: linear-gradient(to bottom right, black, transparent 72%);
  pointer-events: none;
}

.story-panel__ring {
  position: absolute;
  border: 1px solid hsl(37 62% 68% / 0.26);
  border-radius: 50%;
  pointer-events: none;
}

.story-panel__ring--large {
  right: -230px;
  bottom: -200px;
  width: 570px;
  height: 570px;
}

.story-panel__ring--small {
  top: 16%;
  right: 12%;
  width: 82px;
  height: 82px;
  box-shadow:
    0 0 0 22px hsl(37 62% 68% / 0.035),
    0 0 0 44px hsl(37 62% 68% / 0.025);
}

.story-panel__content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.eyebrow {
  margin: 0;
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.story-panel h1 {
  margin: 25px 0 24px;
  font-family: var(--serif);
  font-size: clamp(52px, 5.1vw, 82px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.story-panel h1 em {
  color: var(--gold-light);
  font-family: var(--script);
  font-size: 0.84em;
  font-weight: 400;
  letter-spacing: 0;
}

.story-panel__content > p {
  max-width: 440px;
  margin: 0;
  color: hsl(35 20% 82%);
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.8;
}

.story-note {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: clamp(44px, 8vh, 90px);
  color: hsl(35 18% 78%);
  font-size: 12px;
}

.story-note::before {
  width: 42px;
  height: 1px;
  background: hsl(37 58% 66% / 0.55);
  content: "";
}

.story-note svg {
  width: 20px;
  fill: none;
  stroke: var(--gold-light);
  stroke-width: 1.5;
}

.form-panel {
  display: grid;
  min-height: calc(100vh - var(--header-height));
  padding: clamp(38px, 6vw, 92px);
  background:
    radial-gradient(circle at 82% 20%, hsl(36 65% 93% / 0.72), transparent 25%),
    linear-gradient(135deg, var(--paper), var(--paper-deep));
  place-items: center;
}

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

.login-card__heading {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 20px;
  margin-bottom: 42px;
}

.login-card__number {
  display: grid;
  width: 48px;
  height: 48px;
  border: 1px solid hsl(33 48% 75%);
  border-radius: 50%;
  color: var(--gold-dark);
  font-family: var(--serif);
  font-size: 14px;
  place-items: center;
}

.login-card .eyebrow {
  color: var(--gold-dark);
}

.login-card h2 {
  margin: 11px 0 0;
  font-family: var(--serif);
  font-size: clamp(38px, 4vw, 56px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.login-form,
.password-change-form {
  display: grid;
  gap: 22px;
}

.login-card__heading--compact {
  margin-bottom: 8px;
}

.password-change-form .input-shell input {
  padding-left: 16px;
}

.form-field {
  display: grid;
  gap: 9px;
}

.form-field label,
.label-row {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.forgot-button {
  padding: 0;
  border: 0;
  color: var(--gold-dark);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.forgot-button:hover,
.forgot-button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 59px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: hsl(0 0% 100% / 0.72);
  box-shadow: 0 8px 24px hsl(31 20% 40% / 0.045);
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease,
    background 200ms ease;
}

.input-shell:focus-within {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 4px hsl(33 54% 48% / 0.09);
}

.input-shell > svg {
  flex: 0 0 auto;
  width: 20px;
  margin-left: 17px;
  fill: none;
  stroke: var(--gold-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  height: 57px;
  padding: 0 16px 0 13px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.input-shell input::placeholder {
  color: hsl(30 6% 54%);
}

.password-toggle {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin-right: 7px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: hsl(35 42% 93%);
}

.password-toggle svg {
  width: 20px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

.field-error {
  min-height: 16px;
  color: var(--danger);
  font-size: 11px;
}

.form-field.has-error .input-shell {
  border-color: hsl(3 54% 46% / 0.72);
  box-shadow: 0 0 0 3px hsl(3 54% 46% / 0.07);
}

.remember-control {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 9px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  user-select: none;
}

.remember-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.custom-check {
  display: grid;
  width: 19px;
  height: 19px;
  border: 1px solid hsl(33 36% 72%);
  border-radius: 5px;
  background: var(--white);
  place-items: center;
  transition:
    border-color 180ms ease,
    background 180ms ease;
}

.custom-check svg {
  width: 13px;
  fill: none;
  stroke: var(--white);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 180ms ease,
    transform 180ms var(--ease);
}

.remember-control input:checked + .custom-check {
  border-color: var(--gold-dark);
  background: var(--gold-dark);
}

.remember-control input:checked + .custom-check svg {
  opacity: 1;
  transform: scale(1);
}

.remember-control input:focus-visible + .custom-check {
  outline: 3px solid hsl(33 54% 48% / 0.18);
  outline-offset: 2px;
}

.submit-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  margin-top: 2px;
  padding: 0 19px 0 24px;
  border: 0;
  border-radius: 14px;
  color: var(--white);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  box-shadow: 0 13px 30px hsl(32 54% 42% / 0.2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition:
    box-shadow 220ms ease,
    transform 220ms var(--ease);
}

.submit-button svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 220ms var(--ease);
}

.submit-button:hover,
.submit-button:focus-visible {
  box-shadow: 0 16px 34px hsl(32 54% 42% / 0.28);
  transform: translateY(-2px);
}

.submit-button:hover svg {
  transform: translateX(3px);
}

.form-message {
  min-height: 19px;
  margin: -7px 0 0;
  color: hsl(4 58% 42%);
  font-size: 12px;
  line-height: 1.55;
}

.form-message.is-info {
  color: var(--gold-dark);
}

.support-note {
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.support-note a {
  color: var(--gold-dark);
  font-weight: 700;
}

.support-note a:hover,
.support-note a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 960px) {
  .login-main {
    grid-template-columns: minmax(300px, 0.8fr) minmax(460px, 1.2fr);
  }

  .story-panel {
    padding-inline: clamp(30px, 5vw, 58px);
  }

  .story-panel h1 {
    font-size: clamp(46px, 6vw, 64px);
  }

  .story-note::before {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 74px;
  }

  .login-header {
    padding-inline: 17px;
  }

  .brand {
    gap: 6px;
  }

  .brand__mark {
    width: 34px;
    height: 34px;
  }

  .brand__name {
    font-size: clamp(22px, 7vw, 28px);
  }

  .brand__year {
    display: none;
  }

  .back-link {
    font-size: 0;
  }

  .back-link svg {
    width: 24px;
  }

  .login-main {
    display: block;
  }

  .story-panel {
    min-height: auto;
    padding: 44px 23px 48px;
  }

  .story-panel__content {
    max-width: 520px;
  }

  .story-panel h1 {
    margin: 17px 0 15px;
    font-size: clamp(42px, 13vw, 62px);
  }

  .story-panel__content > p {
    font-size: 13px;
    line-height: 1.65;
  }

  .story-note {
    display: none;
  }

  .story-panel__ring--small {
    top: 18%;
    right: 7%;
    width: 58px;
    height: 58px;
  }

  .story-panel__ring--large {
    right: -130px;
    bottom: -170px;
    width: 330px;
    height: 330px;
  }

  .form-panel {
    min-height: auto;
    padding: 46px 20px 54px;
  }

  .login-card__heading {
    gap: 14px;
    margin-bottom: 32px;
  }

  .login-card__number {
    width: 42px;
    height: 42px;
  }

  .login-card h2 {
    margin-top: 9px;
    font-size: clamp(36px, 11vw, 48px);
  }
}

@media (max-width: 380px) {
  .story-panel {
    padding-inline: 18px;
  }

  .form-panel {
    padding-inline: 16px;
  }

  .login-card__number {
    display: none;
  }

  .login-card__heading {
    display: block;
  }
}

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