:root {
  --ink: #102328;
  --deep: #09181c;
  --paper: #f5f1e8;
  --dim: #c6d3ce;
  --muted: #789095;
  --mint: #b9f28a;
  --coral: #ff735d;
  --line: rgba(188, 218, 208, .14);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--deep); }
body { margin: 0; color: var(--paper); background: var(--deep); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
[hidden] { display: none !important; }

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 96px);
  min-height: 100svh;
  padding: clamp(28px, 4vh, 48px) 8vw;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 18%, rgba(185, 242, 138, .1), transparent 27rem),
    linear-gradient(180deg, rgba(5, 12, 22, .58), rgba(5, 12, 22, .78)),
    url("/assets/background_darkmode.png") center / cover no-repeat;
}

.auth-art { position: relative; min-height: 560px; overflow: hidden; }
.auth-art img { position: absolute; top: 50%; left: 50%; width: min(96%, 620px); aspect-ratio: 1; object-fit: contain; opacity: .58; transform: translate(-50%, -50%); }
.auth-leaves { position: absolute; top: 50%; left: 50%; width: min(96%, 620px); aspect-ratio: 1; overflow: hidden; pointer-events: none; transform: translate(-50%, -50%); }
.auth-leaves i {
  --duration: 15s;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 13px;
  background: rgba(211, 255, 173, .82);
  border-radius: 85% 15% 80% 20%;
  box-shadow: 0 0 9px rgba(185, 242, 138, .42);
  opacity: 0;
  animation: leaf-swirl var(--duration) ease-in-out infinite;
}
.auth-leaves i:nth-child(1) { --x0: -220px; --y0: -55px; --x1: -145px; --y1: -145px; --x2: -35px; --y2: -190px; --x3: 105px; --y3: -145px; animation-delay: -2s; }
.auth-leaves i:nth-child(2) { --x0: -165px; --y0: 150px; --x1: -55px; --y1: 190px; --x2: 85px; --y2: 145px; --x3: 190px; --y3: 45px; --duration: 18s; animation-delay: -11s; }
.auth-leaves i:nth-child(3) { --x0: 25px; --y0: -215px; --x1: 135px; --y1: -165px; --x2: 195px; --y2: -45px; --x3: 145px; --y3: 90px; --duration: 17s; animation-delay: -6s; }
.auth-leaves i:nth-child(4) { --x0: 190px; --y0: 65px; --x1: 125px; --y1: 155px; --x2: 5px; --y2: 195px; --x3: -125px; --y3: 145px; --duration: 20s; animation-delay: -14s; }
.auth-leaves i:nth-child(5) { --x0: -75px; --y0: -180px; --x1: 25px; --y1: -120px; --x2: 75px; --y2: -20px; --x3: 40px; --y3: 95px; --duration: 13s; animation-delay: -8s; }
.auth-leaves i:nth-child(6) { --x0: -190px; --y0: 30px; --x1: -105px; --y1: -35px; --x2: 15px; --y2: -50px; --x3: 130px; --y3: 10px; --duration: 16s; animation-delay: -4s; }
.auth-leaves i:nth-child(7) { --x0: 75px; --y0: 185px; --x1: -25px; --y1: 135px; --x2: -75px; --y2: 35px; --x3: -35px; --y3: -80px; --duration: 19s; animation-delay: -16s; }
.auth-leaves i:nth-child(8) { --x0: 170px; --y0: -105px; --x1: 195px; --y1: 5px; --x2: 140px; --y2: 115px; --x3: 25px; --y3: 175px; --duration: 14s; animation-delay: -9s; }
.auth-leaves i:nth-child(9) { --x0: -120px; --y0: 185px; --x1: -195px; --y1: 90px; --x2: -185px; --y2: -35px; --x3: -95px; --y3: -125px; --duration: 21s; animation-delay: -5s; }
.auth-leaves i:nth-child(10) { --x0: 205px; --y0: -20px; --x1: 145px; --y1: -105px; --x2: 40px; --y2: -145px; --x3: -65px; --y3: -105px; --duration: 18s; animation-delay: -1s; }
.auth-leaves i:nth-child(11) { --x0: -30px; --y0: 210px; --x1: 85px; --y1: 180px; --x2: 155px; --y2: 85px; --x3: 155px; --y3: -30px; --duration: 16s; animation-delay: -13s; }
.auth-leaves i:nth-child(12) { --x0: -205px; --y0: -115px; --x1: -105px; --y1: -185px; --x2: 20px; --y2: -175px; --x3: 115px; --y3: -95px; --duration: 22s; animation-delay: -18s; }
.auth-leaves i:nth-child(3n) { width: 5px; height: 9px; background: rgba(255, 255, 245, .7); }
.auth-leaves i:nth-child(4n) { width: 10px; height: 16px; background: rgba(121, 185, 178, .65); }
@keyframes leaf-swirl {
  0% { opacity: 0; transform: translate(var(--x0), var(--y0)) rotate(0deg) scale(.55); }
  16% { opacity: .58; }
  38% { transform: translate(var(--x1), var(--y1)) rotate(145deg) scale(.85); }
  68% { opacity: .42; transform: translate(var(--x2), var(--y2)) rotate(285deg) scale(.7); }
  100% { opacity: 0; transform: translate(var(--x3), var(--y3)) rotate(440deg) scale(.45); }
}
.auth-copy { width: 100%; max-width: 740px; justify-self: center; padding-top: 88px; }
.brand { position: absolute; top: clamp(18px, 3vh, 34px); left: 50%; display: flex; align-items: center; gap: 13px; transform: translateX(-50%); }
.brand img { width: 76px; height: 60px; object-fit: contain; filter: drop-shadow(0 5px 12px rgba(104, 169, 165, .2)); }
.brand strong, .brand span { display: block; white-space: nowrap; }
.brand strong { color: #fffdf7; font-family: "Avenir Next", Montserrat, Raleway, "Century Gothic", Arial, sans-serif; font-size: 20px; font-weight: 300; letter-spacing: .2em; }
.brand span { margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow { color: var(--mint); font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 18px 0 19px; font-family: Georgia, serif; font-size: clamp(48px, 6vw, 82px); font-weight: 400; letter-spacing: -.06em; line-height: .9; white-space: nowrap; }
h1 em { color: var(--mint); font-style: normal; }
.auth-heading p { max-width: 465px; color: var(--dim); font-size: 15px; line-height: 1.65; }
form { display: grid; max-width: 390px; gap: 14px; margin-top: 32px; }
.field { display: grid; gap: 7px; }
[data-auth-pane="invite"] { display: grid; gap: 14px; }
label { color: var(--dim); font-size: 12px; font-weight: 800; }
label span { color: var(--muted); font-weight: 400; }
input { min-height: 43px; padding: 0 13px; color: var(--paper); background: #0f2329; border: 1px solid var(--line); border-radius: 5px; outline: 0; }
input:focus { border-color: rgba(185, 242, 138, .6); box-shadow: 0 0 0 3px rgba(185, 242, 138, .08); }
button { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-height: 43px; margin-top: 8px; color: var(--deep); background: var(--mint); border: 1px solid var(--mint); border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 900; letter-spacing: .03em; transition: .2s ease; }
button:hover { background: #d3ffad; box-shadow: 0 8px 24px rgba(185, 242, 138, .18); transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: .45; transform: none; }
button span { font-size: 17px; line-height: 0; }
.auth-banner { padding: 11px 13px; color: var(--dim); background: rgba(185, 242, 138, .07); border: 1px solid rgba(185, 242, 138, .2); border-radius: 5px; font-size: 12px; line-height: 1.45; }
.auth-banner[data-tone="error"] { color: #ffb3a7; background: rgba(255, 115, 93, .07); border-color: rgba(255, 115, 93, .25); }
.form-status { min-height: 18px; margin: -5px 0 0; color: var(--coral); font-size: 12px; }
.auth-note { display: flex; align-items: center; gap: 9px; max-width: 390px; margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.auth-note i { width: 7px; height: 7px; flex: 0 0 7px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 0 4px rgba(185, 242, 138, .08); }

@media (max-width: 820px) {
  .auth-layout { grid-template-columns: 1fr; align-content: start; padding: 118px 24px 42px; overflow: visible; }
  .auth-art { min-height: 280px; order: 2; }
  .auth-art img { width: min(100%, 390px); }
  .auth-copy { padding: 0; }
  h1 { font-size: clamp(43px, 12vw, 66px); white-space: normal; }
  form { max-width: none; }
  .auth-note { max-width: none; }
}

@media (max-height: 680px) and (min-width: 821px) {
  .auth-layout { padding-top: 96px; overflow: auto; }
  .auth-art { min-height: 460px; }
  .auth-copy { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-leaves { display: none; }
}
