:root {
  color-scheme: light;
  --orange: #ff9638;
  --orange-deep: #9b3f08;
  --yellow: #ffec00;
  --ink: #191510;
  --paper: #fffaf0;
  --white: #fff;
  --line: #ded7c8;
  --muted: #655c51;
  --danger: #9f251c;
  --success: #21633b;
  --shadow: 0 18px 48px rgba(72, 39, 12, .14), 0 3px 8px rgba(72, 39, 12, .08);
  font-family: Comfortaa, "Arial Rounded MT Bold", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #f3eadc; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
::selection { color: var(--ink); background: var(--yellow); }
*:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.shell { min-height: 100vh; min-height: 100dvh; }

.loading {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--orange);
  font-size: 13px;
  font-weight: 700;
}

.loading img { width: 112px; height: 112px; object-fit: contain; }

.auth-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 540px);
  background: var(--paper);
}

.auth-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(30px, 5vw, 72px);
  overflow: hidden;
  background: var(--orange);
}

.brand-logo {
  position: relative;
  z-index: 2;
  width: 118px;
  height: 118px;
  object-fit: contain;
}

.auth-art-copy { position: relative; z-index: 2; max-width: 620px; }
.auth-art h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(42px, 6.5vw, 88px);
  line-height: .95;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.auth-art h1 span { display: inline; background: var(--yellow); box-decoration-break: clone; padding: 0 .1em; }
.auth-art p { max-width: 45ch; margin: 28px 0 0; font-size: 15px; font-weight: 700; line-height: 1.7; }

.auth-mascot {
  position: absolute;
  z-index: 1;
  right: -5%;
  bottom: -5%;
  width: min(48vw, 610px);
  max-height: 70vh;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
}

.auth-panel {
  display: grid;
  align-content: center;
  padding: clamp(28px, 6vw, 76px);
  background: var(--paper);
}

.auth-form { width: 100%; max-width: 430px; margin: 0 auto; }
.auth-form h2 { margin: 0 0 12px; font-size: clamp(32px, 4vw, 46px); line-height: 1.08; letter-spacing: -.04em; }
.auth-intro { max-width: 36ch; margin: 0 0 38px; color: var(--muted); font-size: 14px; line-height: 1.7; }

.field { display: block; margin-top: 22px; }
.field > label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.field input {
  display: block;
  width: 100%;
  height: 58px;
  border: 1.5px solid #c8bdac;
  border-radius: 14px;
  padding: 0 16px;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  caret-color: var(--orange-deep);
}
.field input:hover { border-color: #9b8c79; }
.field input:focus { border-color: var(--ink); outline: 3px solid rgba(255, 150, 56, .35); outline-offset: 2px; }
.field input::placeholder { color: #746b61; opacity: 1; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 72px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 54px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}
.password-toggle:hover { background: #f3ede3; }

.form-error { min-height: 22px; margin: 14px 0 2px; color: var(--danger); font-size: 12px; line-height: 1.5; }
.submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 60px;
  margin-top: 10px;
  border: 0;
  border-radius: 14px;
  padding: 0 20px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(117, 83, 0, .12);
  transition: transform 180ms cubic-bezier(.22, 1, .36, 1), box-shadow 180ms cubic-bezier(.22, 1, .36, 1);
}
.submit:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(117, 83, 0, .18); }
.submit:active { transform: translateY(0); }
.submit:disabled { cursor: wait; opacity: .65; transform: none; }
.submit svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.security-note { margin: 24px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }

.dashboard { min-height: 100vh; min-height: 100dvh; background: #f7f1e8; }
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 96px;
  padding: 12px clamp(20px, 5vw, 64px);
  background: var(--orange);
}
.dashboard-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dashboard-brand img { width: 70px; height: 70px; object-fit: contain; flex: none; }
.dashboard-brand strong { display: block; font-size: 15px; }
.dashboard-brand span { display: block; margin-top: 5px; font-size: 11px; font-weight: 700; color: #572605; }
.logout { min-height: 44px; border: 1.5px solid var(--ink); border-radius: 12px; padding: 0 16px; background: rgba(255, 255, 255, .55); font-size: 12px; font-weight: 700; }
.logout:hover { background: var(--white); }

.dashboard-main { width: min(100% - 40px, 1160px); margin: 0 auto; padding: clamp(48px, 8vw, 96px) 0; }
.dashboard-main h1 { max-width: 14ch; margin: 0; font-size: clamp(40px, 6vw, 72px); line-height: 1; letter-spacing: -.04em; text-wrap: balance; }
.dashboard-lead { max-width: 58ch; margin: 22px 0 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.ready-state {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(300px, 1.25fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: end;
  margin-top: clamp(56px, 8vw, 100px);
  border-top: 1px solid var(--line);
  padding-top: 32px;
}
.ready-state img { width: min(100%, 330px); max-height: 320px; object-fit: contain; object-position: left bottom; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--success); font-size: 12px; font-weight: 700; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #2d8a50; box-shadow: 0 0 0 5px rgba(45, 138, 80, .12); }
.ready-copy h2 { margin: 18px 0 12px; font-size: clamp(26px, 4vw, 40px); line-height: 1.15; letter-spacing: -.03em; text-wrap: balance; }
.ready-copy p { max-width: 50ch; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }

@media (max-width: 860px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-art { min-height: 340px; padding: 26px 24px 36px; }
  .brand-logo { width: 82px; height: 82px; }
  .auth-art h1 { max-width: 8ch; font-size: clamp(38px, 12vw, 58px); }
  .auth-art p { max-width: 55%; margin-top: 20px; font-size: 12px; }
  .auth-mascot { width: min(58vw, 360px); max-height: 310px; right: -6%; bottom: -12%; }
  .auth-panel { padding: 42px 24px max(42px, env(safe-area-inset-bottom)); }
  .ready-state { grid-template-columns: 1fr; align-items: start; }
  .ready-state img { width: 190px; order: 2; justify-self: end; margin-top: -80px; opacity: .96; }
}

@media (max-width: 480px) {
  .auth-art { min-height: 310px; }
  .auth-art p { max-width: 62%; }
  .auth-mascot { width: 62vw; right: -12%; }
  .dashboard-header { min-height: 86px; padding-inline: 14px; }
  .dashboard-brand { gap: 8px; }
  .dashboard-brand img { width: 58px; height: 58px; }
  .dashboard-brand strong { font-size: 13px; }
  .dashboard-brand span { font-size: 9px; }
  .logout { padding-inline: 12px; }
  .dashboard-main { width: min(100% - 32px, 1160px); }
  .ready-state img { width: 140px; margin-top: -44px; }
}

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