:root {
  --paper: #f4eddf;
  --paper-light: #fbf7ee;
  --ink: #17362d;
  --wine: #6b171b;
  --gold: #a87833;
  --muted: #706b60;
  --line: #cdbf9f;
}

* { box-sizing: border-box; }

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

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 76% 38%, rgba(168, 120, 51, .11), transparent 24rem),
    radial-gradient(rgba(50, 39, 24, .035) .7px, transparent .8px),
    var(--paper);
  background-size: auto, 6px 6px, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  right: 0;
  left: 0;
  z-index: 20;
  height: 7px;
  pointer-events: none;
  background: var(--ink);
}

body::before { top: 0; border-bottom: 2px solid var(--gold); }
body::after { bottom: 0; border-top: 2px solid var(--gold); }

.login-shell {
  width: min(1500px, calc(100% - 72px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 22px 0 34px;
}

.login-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  border-bottom: 1px solid rgba(168, 120, 51, .7);
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  letter-spacing: -.035em;
  text-decoration: none;
}

.login-brand img {
  width: 36px;
  height: 36px;
  border-radius: 7px;
}

.back-link {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  text-decoration-color: rgba(23, 54, 45, .42);
  text-underline-offset: 4px;
  transition: color .16s ease, text-decoration-color .16s ease;
}

.back-link span { display: inline-block; margin-left: 5px; transition: transform .16s ease; }
.back-link:hover { color: var(--wine); text-decoration-color: currentColor; }
.back-link:hover span { transform: translateX(3px); }

.login-main {
  display: grid;
  grid-template-columns: minmax(380px, .82fr) minmax(610px, 1.35fr);
  gap: clamp(40px, 5vw, 88px);
  align-items: center;
  min-height: calc(100svh - 118px);
}

.login-copy { align-self: center; max-width: 570px; padding: 10px 0 24px 2px; }

.login-copy h1 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(62px, 5.2vw, 82px);
  font-weight: 400;
  line-height: .94;
  letter-spacing: -.06em;
}

.login-copy h1 em { color: var(--wine); font-weight: 400; }

.login-subtitle {
  margin: 28px 0 0;
  color: #45463e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 1.35vw, 22px);
  line-height: 1.45;
}

.login-form { margin-top: 31px; }
.login-field { margin-bottom: 18px; }

.login-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.login-input {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(23, 54, 45, .52);
  border-radius: 0;
  outline: 0;
  background: rgba(251, 247, 238, .72);
  color: var(--ink);
  font: 16px Georgia, "Times New Roman", serif;
  box-shadow: inset 0 1px rgba(255, 255, 255, .75);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.login-input::placeholder { color: #8c887e; opacity: 1; }
.login-input:hover { border-color: var(--ink); }
.login-input:focus {
  border-color: var(--gold);
  background: var(--paper-light);
  box-shadow: 0 0 0 2px rgba(168, 120, 51, .18), inset 3px 0 0 var(--wine);
}

.login-submit {
  width: 100%;
  min-height: 62px;
  margin-top: 4px;
  padding: 12px 20px;
  border: 1px solid var(--wine);
  border-radius: 0;
  background: var(--wine);
  color: #fffaf1;
  font: 400 21px Georgia, "Times New Roman", serif;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.login-submit:hover {
  transform: translateY(-2px);
  background: #511014;
  box-shadow: 0 10px 24px rgba(77, 24, 25, .16);
}

.login-submit:active { transform: translateY(0); }
.login-submit:disabled { cursor: wait; opacity: .62; transform: none; }

.form-message {
  margin: 20px 0 -12px;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(251, 247, 238, .72);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.form-message--success { border-color: #3b755c; }
.form-message--error { border-color: var(--wine); color: var(--wine); }

.field-message {
  min-height: 17px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.field-message--success { color: #35684f; }
.field-message--error { color: var(--wine); }

.login-principles {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 22px;
  margin-top: 29px;
  padding-top: 18px;
  border-top: 1px solid var(--gold);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .095em;
  text-transform: uppercase;
}

.login-principles span { position: relative; }
.login-principles span:not(:last-child)::after {
  content: "·";
  position: absolute;
  right: -14px;
  color: var(--gold);
}

.login-copy--register h1 { font-size: clamp(54px, 4.3vw, 68px); }
.login-copy--register .login-subtitle { margin-top: 20px; }
.login-copy--register .login-principles { display: none; }
.login-copy--register .login-form { margin-top: 24px; }
.login-copy--register .login-field { margin-bottom: 12px; }
.login-copy--register .login-input { height: 52px; }
.login-copy--register .login-submit { min-height: 56px; }

#register-form { display: none; }

.toggle-text {
  display: block;
  margin: 18px auto 0;
  padding: 3px;
  border: 0;
  background: transparent;
  color: var(--wine);
  font: 15px Georgia, "Times New Roman", serif;
  text-decoration: underline;
  text-decoration-color: rgba(107, 23, 27, .38);
  text-underline-offset: 4px;
  cursor: pointer;
}

.toggle-text:hover { text-decoration-color: currentColor; }

.resend-verification {
  display: block;
  margin: 14px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 13px Georgia, "Times New Roman", serif;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.resend-verification:hover { color: var(--wine); }

.desk-gallery { position: relative; min-width: 0; height: min(69vh, 670px); margin-top: 10px; }

.desk-sheet {
  position: absolute;
  display: grid;
  margin: 0;
  place-items: center;
  padding: 14px;
  border: 1px solid #c6bda9;
  background: radial-gradient(rgba(50, 39, 24, .025) .65px, transparent .75px), #fffdf8;
  background-size: 5px 5px, auto;
  box-shadow: 0 18px 38px rgba(51, 40, 24, .15), 0 3px 7px rgba(51, 40, 24, .08);
  transition: transform .22s ease, box-shadow .22s ease;
  animation: sheet-arrive .7s cubic-bezier(.22,1,.36,1) both;
}

.desk-sheet:hover { z-index: 5; box-shadow: 0 24px 44px rgba(51, 40, 24, .2), 0 3px 7px rgba(51, 40, 24, .08); }

.paper-tape {
  position: absolute;
  z-index: 2;
  top: -7px;
  left: 50%;
  width: 76px;
  height: 16px;
  background: rgba(222, 203, 160, .67);
  box-shadow: 0 1px 2px rgba(51, 40, 24, .12);
  transform: translateX(-50%) rotate(-1deg);
}

.desk-sheet img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }

.desk-sheet--rnn {
  z-index: 2;
  top: 1%;
  left: 2%;
  width: 43%;
  height: 57%;
  transform: rotate(-3deg);
}
.desk-sheet--rnn:hover { transform: translateY(-5px) rotate(-1deg); }

.desk-sheet--pipeline {
  z-index: 3;
  top: 14%;
  right: 0;
  width: 51%;
  height: 51%;
  transform: rotate(2.2deg);
  animation-delay: .08s;
}
.desk-sheet--pipeline:hover { transform: translateY(-5px) rotate(.6deg); }

.desk-sheet--sunflower {
  z-index: 4;
  right: 23%;
  bottom: 0;
  width: 39%;
  height: 45%;
  transform: rotate(-1.8deg);
  animation-delay: .16s;
}
.desk-sheet--sunflower:hover { transform: translateY(-5px) rotate(-.5deg); }
.desk-note {
  position: absolute;
  right: 1%;
  bottom: 8%;
  margin: 0;
  color: #393a35;
  font: italic clamp(20px, 2.1vw, 32px)/.95 Georgia, "Times New Roman", serif;
  text-align: center;
  transform: rotate(-8deg);
}
.desk-note::after { content: ""; display: block; width: 68px; margin: 11px auto 0; border-bottom: 2px solid var(--gold); transform: rotate(-15deg); }

a,
button,
input { -webkit-tap-highlight-color: transparent; }
a:focus-visible,
button:focus-visible { outline: 3px solid rgba(107, 23, 27, .25); outline-offset: 3px; }

@keyframes sheet-arrive {
  from { opacity: 0; translate: 0 18px; }
  to { opacity: 1; translate: 0 0; }
}

@media (max-width: 1120px) {
  .login-shell { width: min(100% - 42px, 1050px); }
  .login-main { grid-template-columns: minmax(335px, .8fr) minmax(530px, 1.2fr); gap: 28px; }
  .login-copy h1 { font-size: clamp(52px, 5.8vw, 65px); }
  .login-principles { gap: 7px 14px; }
  .login-principles span::after { display: none; }
}

@media (max-width: 860px) {
  .login-shell { width: min(100% - 30px, 680px); height: auto; padding-bottom: 38px; }
  .login-main { grid-template-columns: 1fr; gap: 32px; min-height: 0; padding: 44px 0 34px; }
  .login-copy { width: min(100%, 540px); margin: 0 auto; padding: 0; text-align: center; }
  .login-copy h1 { font-size: clamp(56px, 13vw, 78px); }
  .login-subtitle { margin-top: 22px; }
  .login-form { text-align: left; }
  .login-principles { justify-content: center; }
  .desk-gallery { width: min(100%, 650px); height: 480px; margin: 0 auto; }
}

@media (max-width: 540px) {
  .login-shell { width: calc(100% - 24px); padding-top: 18px; }
  .login-nav { height: 56px; }
  .login-brand { font-size: 21px; }
  .login-brand img { width: 32px; height: 32px; }
  .back-link { font-size: 12px; }
  .login-main { gap: 22px; padding: 28px 0 20px; }
  .login-copy h1 { font-size: clamp(49px, 15vw, 66px); }
  .login-subtitle { margin-top: 17px; font-size: 16px; }
  .login-form { margin-top: 22px; }
  .login-label { font-size: 15px; }
  .login-input { height: 53px; font-size: 15px; }
  .login-submit { min-height: 56px; font-size: 19px; }
  .login-principles { margin-top: 21px; padding-top: 13px; font-size: 8px; }
  .desk-gallery { height: 285px; }
  .desk-sheet { padding: 7px; }
  .paper-tape { width: 44px; height: 10px; top: -5px; }
  .desk-note { display: none; }
  .desk-sheet--rnn { left: 0; width: 47%; height: 58%; }
  .desk-sheet--pipeline { top: 12%; width: 54%; height: 51%; }
  .desk-sheet--sunflower { right: 21%; width: 43%; height: 45%; }
}

@media (max-width: 380px) {
  .login-brand span { display: none; }
}

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