:root {
  --ink: #050a04;
  --forest: #0b1609;
  --forest-soft: #152510;
  --lime: #a3e635;
  --lime-deep: #8ab840;
  --paper: #f2f0e8;
  --paper-deep: #e7e5dc;
  --charcoal: #151913;
  --muted: #6b7068;
  --line: rgba(21, 25, 19, 0.16);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Manrope", Arial, sans-serif;
  --display: "Inter", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: white;
  background: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--lime);
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform 160ms ease-out;
}
.skip-link:focus { transform: translateY(0); }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(470px, 0.82fr);
  min-height: 100dvh;
}

.story-panel {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 42px 36px;
}

.story-panel::after {
  content: "CARBON LENS";
  position: absolute;
  z-index: -1;
  right: -0.03em;
  bottom: -0.17em;
  color: rgba(255,255,255,0.055);
  font: 700 clamp(88px, 12vw, 210px)/0.8 var(--display);
  white-space: nowrap;
  pointer-events: none;
}

.story-media, .story-shade {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.story-landscape {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.72) contrast(1.1);
  transform: scale(1.025);
  animation: settle 1s ease-out both;
}

.story-machine {
  position: absolute;
  z-index: 1;
  top: -3%;
  right: -10%;
  width: min(78%, 850px);
  height: 77%;
  object-fit: contain;
  object-position: top right;
  opacity: 0.92;
  animation: machine-in 1s 100ms ease-out both;
}

.story-shade {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(2,7,2,.68) 0%, rgba(2,7,2,.12) 64%, rgba(2,7,2,.35) 100%),
    linear-gradient(0deg, rgba(2,7,2,.94) 0%, rgba(2,7,2,.12) 62%, rgba(2,7,2,.55) 100%);
}

.story-header, .story-footer, .impact-stat, .auth-panel-top, .auth-footer {
  display: flex;
  align-items: center;
}

.story-header { justify-content: space-between; }
.brand { display: inline-flex; }
.brand img { display: block; width: 168px; height: auto; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  transition: color 160ms ease-out, transform 160ms ease-out;
}
.back-link:hover { color: white; transform: translateX(-3px); }

.story-copy {
  max-width: 770px;
  margin-top: auto;
  margin-bottom: clamp(62px, 10vh, 120px);
  animation: copy-in .8s 180ms ease-out both;
}

.eyebrow, .auth-kicker {
  margin: 0 0 24px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
}
.eyebrow { display: flex; align-items: center; gap: 14px; color: rgba(255,255,255,.68); }
.eyebrow span { width: 36px; height: 1px; background: var(--lime-deep); }

.story-copy h1 {
  margin: 0;
  max-width: 760px;
  font: 700 clamp(48px, 5.3vw, 92px)/.94 var(--display);
  letter-spacing: -.06em;
  text-wrap: balance;
}
.story-copy h1 em, .auth-heading h2 em { color: var(--lime); font-family: var(--serif); font-weight: 600; }

.story-description {
  max-width: 540px;
  margin: 28px 0 0;
  color: rgba(255,255,255,.62);
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.7;
  text-wrap: pretty;
}

.story-footer {
  min-height: 70px;
  gap: 40px;
  border-top: 1px solid rgba(255,255,255,.16);
  padding-top: 20px;
}
.live-marker { margin-right: auto; color: rgba(255,255,255,.62); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.live-marker i { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(163,230,53,.1); }
.impact-stat { gap: 13px; }
.impact-stat strong { color: var(--lime); font: 700 30px/1 var(--display); letter-spacing: -.05em; }
.impact-stat span { color: rgba(255,255,255,.52); font-size: 10px; line-height: 1.35; text-transform: uppercase; }
.story-index { margin: 0; color: rgba(255,255,255,.38); font-size: 11px; }

.auth-panel {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 30px clamp(38px, 5vw, 84px) 24px;
  color: var(--charcoal);
  background: var(--paper);
  border-left: 1px solid rgba(255,255,255,.15);
}

.auth-panel-top, .auth-footer { justify-content: space-between; }
.auth-panel-top p, .auth-footer p { margin: 0; }
.auth-panel-top { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; }

.auth-wrap {
  width: 100%;
  max-width: 480px;
  margin: auto;
  padding: 44px 0 48px;
  animation: form-in .75s 120ms ease-out both;
}

.auth-heading { margin-bottom: 34px; }
.auth-kicker { margin-bottom: 13px; color: #71845c; }
.auth-heading h2 {
  margin: 0;
  font: 700 clamp(38px, 3.2vw, 56px)/1 var(--display);
  letter-spacing: -.055em;
}
.auth-heading h2 em { color: #617d2d; }
.auth-heading > p:last-child { margin: 15px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; text-wrap: pretty; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  position: relative;
  border: 0;
  padding: 0 0 14px;
  color: #8b8f87;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease-out;
}
.auth-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--charcoal);
  transform: scaleX(0);
  transition: transform 180ms ease-out;
}
.auth-tab:hover, .auth-tab.is-active { color: var(--charcoal); }
.auth-tab.is-active::after { transform: scaleX(1); }

.field { margin-bottom: 18px; }
.field[hidden] { display: none; }
.remember[hidden], .label-row a[hidden] { display: none; }
.field.is-entering { animation: field-in 180ms ease-out both; }
.field label, .label-row a { font-size: 12px; font-weight: 600; }
.field > label, .label-row { display: flex; margin-bottom: 8px; }
.label-row { align-items: center; justify-content: space-between; }
.label-row a { color: #69765a; text-decoration: none; }
.label-row a:hover { text-decoration: underline; }

.field input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  padding: 0 15px;
  color: var(--charcoal);
  background: rgba(255,255,255,.36);
  font-size: 14px;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out, background-color 160ms ease-out;
}
.field input::placeholder { color: #9c9e97; }
.field input:hover { border-color: rgba(21,25,19,.32); }
.field input:focus { border-color: #647f32; box-shadow: 0 0 0 3px rgba(100,127,50,.12); background: rgba(255,255,255,.62); }
.field input[aria-invalid="true"] { border-color: #a04435; }

.field-error { min-height: 0; margin: 5px 0 0; color: #a04435; font-size: 11px; }
.field-error:empty { display: none; }

.password-control { position: relative; }
.password-control input { padding-right: 54px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  color: #656b61;
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}
.password-toggle svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }

.remember {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 2px 0 24px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.remember input { position: absolute; opacity: 0; pointer-events: none; }
.remember span { width: 16px; height: 16px; border: 1px solid rgba(21,25,19,.28); background: rgba(255,255,255,.3); }
.remember input:focus-visible + span { outline: 2px solid #647f32; outline-offset: 2px; }
.remember input:checked + span { background: var(--charcoal); box-shadow: inset 0 0 0 4px var(--paper); }

.submit-button, .google-button {
  width: 100%;
  height: 54px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}
.submit-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 6px 5px 21px;
  color: white;
  background: var(--charcoal);
  transition: transform 160ms ease-out, background-color 160ms ease-out;
}
.submit-button:hover { background: #293522; transform: translateY(-2px); }
.submit-button:active { transform: translateY(0); }
.submit-button:disabled { cursor: wait; opacity: .72; transform: none; }
.submit-icon { display: grid; place-items: center; width: 43px; height: 43px; color: var(--ink); background: var(--lime); font-size: 20px; transition: transform 160ms ease-out; }
.submit-button:hover .submit-icon { transform: rotate(8deg); }
.submit-button.is-loading .submit-icon { color: transparent; }
.submit-button.is-loading .submit-icon::after { content: ""; width: 14px; height: 14px; border: 2px solid rgba(5,10,4,.28); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; }

.form-status { min-height: 18px; margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.form-status[data-state="error"] { color: #a04435; }
.form-status[data-state="success"] { color: #527121; }

.or-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: #969990; font-size: 11px; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google-button { display: flex; align-items: center; justify-content: center; gap: 11px; border: 1px solid var(--line); color: var(--charcoal); background: transparent; transition: border-color 160ms ease-out, background-color 160ms ease-out; }
.google-button svg { width: 18px; }
.google-button:hover { border-color: rgba(21,25,19,.35); background: rgba(255,255,255,.4); }

.auth-footer { padding-top: 20px; border-top: 1px solid var(--line); color: #858981; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.auth-footer div { display: flex; gap: 18px; }
.auth-footer a { text-decoration: none; }
.auth-footer a:hover { color: var(--charcoal); }

:focus-visible { outline: 2px solid var(--lime-deep); outline-offset: 3px; }

@keyframes settle { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1.025); } }
@keyframes machine-in { from { opacity: 0; transform: translate(70px,-30px); } to { opacity: .92; transform: translate(0,0); } }
@keyframes copy-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes form-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes field-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1080px) {
  .auth-shell { grid-template-columns: minmax(0, .9fr) minmax(440px, 1.1fr); }
  .story-panel { padding: 28px; }
  .story-copy h1 { font-size: clamp(43px, 5.7vw, 68px); }
  .story-machine { right: -24%; width: 100%; }
  .impact-stat { display: none; }
}

@media (max-width: 820px) {
  .auth-shell { display: block; }
  .story-panel { min-height: 360px; padding: 24px; }
  .story-machine { right: -6%; height: 100%; width: 68%; opacity: .72; }
  .story-copy { margin: 70px 0 36px; }
  .story-copy h1 { max-width: 580px; font-size: clamp(42px, 9vw, 68px); }
  .story-description { display: none; }
  .story-footer { display: none; }
  .auth-panel { min-height: auto; padding: 24px clamp(24px, 8vw, 70px); }
  .auth-wrap { max-width: 560px; padding: 64px 0; }
}

@media (max-width: 520px) {
  .story-panel { min-height: 280px; }
  .brand img { width: 142px; }
  .back-link { font-size: 0; }
  .back-link span { font-size: 20px; }
  .story-copy { margin: auto 0 12px; }
  .eyebrow { margin-bottom: 14px; font-size: 9px; }
  .story-copy h1 { font-size: clamp(37px, 12vw, 55px); }
  .story-machine { right: -25%; width: 90%; }
  .auth-panel { padding: 22px 20px; }
  .auth-panel-top p:first-child, .auth-footer p { display: none; }
  .auth-panel-top { justify-content: flex-end; }
  .auth-wrap { padding: 48px 0 42px; }
  .auth-heading h2 { font-size: 40px; }
  .auth-footer { justify-content: flex-end; }
}

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