@import url('../fonts/fonts.css');

/* Login and signup share the landing page's warm paper and character art. */
.auth-page {
  --auth-ink: #1d1712;
  --auth-muted: #6c5f55;
  --auth-line: #e8dacb;
  --auth-coral: #c75232;
  background:
    radial-gradient(circle at 9% 18%, rgba(242, 177, 117, .12), transparent 29%),
    radial-gradient(circle at 90% 88%, rgba(213, 111, 83, .08), transparent 27%),
    #f6f0e7;
  color: var(--auth-ink);
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
}

.auth-shell {
  display: block;
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(430px, .96fr);
  align-items: stretch;
  gap: 22px;
}

.auth-story {
  position: sticky;
  top: 22px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 44px);
  overflow: hidden;
  border: 1px solid #dfc9b3;
  border-radius: 28px;
  background:
    radial-gradient(circle at 67% 65%, rgba(255, 242, 218, .9), transparent 40%),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(134, 87, 59, .045) 39px 40px),
    #efddc8;
  box-shadow: 0 14px 48px rgba(83, 50, 27, .09);
}

.auth-story::before,
.auth-story::after {
  content: '';
  position: absolute;
  z-index: 0;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(147, 86, 49, .14);
  border-radius: 50%;
  pointer-events: none;
}

.auth-story::before { right: -165px; top: 23%; }
.auth-story::after { right: -114px; top: 29%; }

.auth-brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  margin: 34px 42px 0;
  color: var(--auth-ink);
  font: 800 1.35rem 'Bricolage Grotesque', system-ui, sans-serif;
}

.auth-brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--auth-ink);
  color: #fff5e8;
  font: italic 700 1.45rem 'Instrument Serif', Georgia, serif;
  transform: rotate(-6deg);
}

.auth-story-copy {
  position: relative;
  z-index: 2;
  max-width: 510px;
  margin: clamp(46px, 10vh, 100px) 42px 0;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #a7482b;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.auth-eyebrow::before {
  content: '';
  width: 21px;
  height: 2px;
  background: currentColor;
}

.auth-story-copy h2 {
  margin: 20px 0 18px;
  color: var(--auth-ink);
  font: 800 clamp(3rem, 5.1vw, 5rem)/.99 'Bricolage Grotesque', system-ui, sans-serif;
  letter-spacing: -.065em;
}

.auth-story-copy h2 em {
  display: block;
  color: var(--auth-coral);
  font: italic 400 1.08em/.97 'Instrument Serif', Georgia, serif;
  letter-spacing: -.035em;
}

.auth-story-copy p {
  max-width: 370px;
  color: #655447;
  font-size: 1.05rem;
  line-height: 1.55;
}

.auth-mascots {
  position: relative;
  z-index: 1;
  display: block;
  width: min(78%, 505px);
  height: auto;
  max-height: 46vh;
  object-fit: contain;
  object-position: center bottom;
  margin: auto auto -4%;
  filter: drop-shadow(0 24px 27px rgba(87, 51, 25, .17));
}

.auth-story-foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 16px 12px 20px;
  border-top: 1px solid rgba(115, 77, 54, .13);
  color: #6d5949;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .035em;
  text-align: center;
}

.auth-story-foot span { color: var(--auth-coral); }

.auth-panel-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(28px, 5vw, 70px);
}

.auth-register .auth-panel-main { justify-content: flex-start; }

.auth-back {
  align-self: flex-start;
  margin: 0 0 clamp(32px, 5vh, 64px);
  color: var(--auth-muted);
  font-size: .86rem;
  font-weight: 700;
}

.auth-back:hover { color: var(--auth-coral); }

.auth-copy { margin-bottom: 26px; }

.auth-copy .section-tag,
#signupSuccess .section-tag {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--auth-coral);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .15em;
}

.auth-copy h1 {
  max-width: 570px;
  margin: 12px 0 11px;
  color: var(--auth-ink);
  font: 800 clamp(2.35rem, 3.7vw, 3.65rem)/1.02 'Bricolage Grotesque', system-ui, sans-serif;
  letter-spacing: -.065em;
}

.auth-copy p {
  max-width: 470px;
  color: var(--auth-muted);
  font-size: .99rem;
  line-height: 1.55;
}

.auth-stack { gap: 13px; }

.auth-card {
  gap: 15px;
  padding: 27px;
  border: 1px solid var(--auth-line);
  border-radius: 23px;
  background: rgba(255, 252, 247, .93);
  box-shadow: 0 14px 38px rgba(74, 42, 23, .07), 0 2px 8px rgba(74, 42, 23, .035);
  backdrop-filter: none;
}

.auth-card-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 13px;
  padding: 19px 22px;
}

.auth-page .input-group { gap: 8px; }

.auth-page .input-group label {
  color: #342a23;
  font-size: .86rem;
  font-weight: 800;
}

.auth-page .input-field {
  min-height: 50px;
  padding: 12px 15px;
  border: 1px solid #dfd0c1;
  border-radius: 11px;
  background: #fffdfa;
  color: var(--auth-ink);
  font: 500 .96rem 'Atkinson Hyperlegible', system-ui, sans-serif;
  box-shadow: none;
}

.auth-page .input-field::placeholder { color: #a99a8d; }

.auth-page .input-field:focus {
  border-color: var(--auth-coral);
  outline: none;
  box-shadow: 0 0 0 4px rgba(199, 82, 50, .13);
}

.auth-page .btn {
  min-height: 49px;
  border-radius: 10px;
  font: 800 .92rem 'Atkinson Hyperlegible', system-ui, sans-serif;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.auth-page .btn-primary {
  background: var(--auth-ink);
  color: #fffaf3;
  box-shadow: 3px 4px 0 var(--auth-coral);
}

.auth-page .btn-primary:hover {
  transform: translate(-1px, -1px);
  background: #36251b;
  box-shadow: 4px 5px 0 var(--auth-coral);
}

.auth-page .btn-secondary {
  padding: 0 18px;
  border: 1px solid #d9c7b7;
  background: #f7eee4;
  color: #37291f;
  white-space: nowrap;
}

.auth-page .btn-secondary:hover { background: #edddce; }

.auth-inline-link { margin: -3px 0 0; }
.auth-inline-link a,
.auth-switch a,
.auth-legal-check a { color: #b64a2c; }
.auth-inline-link a:hover,
.auth-switch a:hover,
.auth-legal-check a:hover { text-decoration: underline; }

.auth-switch { color: var(--auth-muted); }
.auth-switch a { font-weight: 800; }
.auth-message { color: var(--auth-muted); }
.auth-message.error,
.field-message.error { color: #ad352c; }
.auth-message.success,
.field-message.success,
.password-guidance li.met { color: #287a51; }

.auth-page .password-toggle {
  right: 9px;
  border-color: #ddcbb9;
  background: #f8eee5;
  color: #674634;
}

.auth-page .password-strength,
.auth-page .password-guidance,
.auth-page .field-message,
.auth-legal-check { color: #786b60; }

.auth-page .strength-meter { background: #eadfd4; }
.auth-legal-check { font-size: .8rem; }
.auth-legal-check input { accent-color: var(--auth-coral); }

.auth-panel-foot {
  margin: 23px 0 0;
  color: #998b7c;
  font-size: .79rem;
  text-align: center;
}

#signupSuccess {
  grid-column: auto;
  margin-top: 0;
}

#signupSuccess h2 {
  color: var(--auth-ink);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  letter-spacing: -.04em;
}

#signupSuccess p { color: var(--auth-muted); }

.auth-page :focus-visible {
  outline: 3px solid var(--auth-coral);
  outline-offset: 3px;
}

@media (max-width: 1030px) {
  .auth-panel { grid-template-columns: minmax(0, .9fr) minmax(390px, 1.1fr); gap: 10px; }
  .auth-panel-main { padding: clamp(22px, 4vw, 46px); }
  .auth-story-copy { margin-left: 30px; margin-right: 30px; }
  .auth-brand { margin-left: 30px; }
}

@media (max-width: 760px) {
  .auth-shell { padding: 12px; }
  .auth-panel { grid-template-columns: 1fr; gap: 0; }
  .auth-story {
    position: relative;
    top: auto;
    min-height: 255px;
    max-height: 290px;
    border-radius: 20px;
  }
  .auth-brand { margin: 20px 22px 0; font-size: 1.15rem; }
  .auth-brand-mark { width: 32px; height: 32px; }
  .auth-story-copy { max-width: 60%; margin: 24px 22px 22px; }
  .auth-story-copy h2 { margin: 8px 0; font-size: clamp(1.7rem, 5vw, 2.4rem); }
  .auth-story-copy p { font-size: .79rem; line-height: 1.36; }
  .auth-eyebrow { font-size: .57rem; letter-spacing: .08em; }
  .auth-mascots {
    position: absolute;
    right: -5%;
    bottom: -16%;
    width: 53%;
    max-height: none;
    margin: 0;
  }
  .auth-story-foot { display: none; }
  .auth-panel-main { padding: 28px 12px 32px; }
  .auth-back { margin-bottom: 25px; }
  .auth-copy { margin-bottom: 20px; }
  .auth-copy h1 { font-size: clamp(2.15rem, 8vw, 3rem); }
  .auth-card { padding: 22px; }
  .auth-card-compact { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .auth-story { min-height: 235px; max-height: 235px; }
  .auth-story-copy { max-width: 63%; }
  .auth-story-copy h2 { font-size: 1.75rem; }
  .auth-story-copy p { font-size: .72rem; }
  .auth-mascots { right: -12%; width: 58%; }
  .auth-card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page .btn { transition: none; }
}
