:root {
  color-scheme: light;
  --ink: #171816;
  --muted: #696a65;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --line: #dedbd4;
  --soft: #f1efe9;
  --red: #cd3d4d;
  --red-dark: #a92c3a;
  --shadow: 0 22px 70px rgb(30 27 22 / 12%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  min-height: 100dvh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(circle at 12% 12%, rgb(205 61 77 / 8%), transparent 30rem),
    linear-gradient(180deg, #fff 0, var(--paper) 42%);
}

button, input { font: inherit; }

.site-brand {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  padding: 9px 8px;
  display: grid;
  gap: 4px;
  border-radius: 12px;
  background: var(--red);
  box-shadow: 0 8px 20px rgb(205 61 77 / 20%);
}

.brand-mark i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.brand-mark i:nth-child(2) { width: 72%; }

.login-shell {
  width: min(1100px, calc(100% - 40px));
  margin: auto;
  padding: 32px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(270px, .85fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
}

.login-card {
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgb(255 255 255 / 94%);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2 { font-family: Georgia, "Times New Roman", serif; }

h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.45rem, 6vw, 4.6rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.lede {
  max-width: 570px;
  margin: 24px 0 32px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.55;
}

.primary-action {
  width: 100%;
  min-height: 58px;
  padding: 14px 18px 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--red);
  box-shadow: 0 12px 24px rgb(205 61 77 / 20%);
  font-weight: 800;
  cursor: pointer;
}

.primary-action:hover { background: var(--red-dark); }
.primary-action:focus-visible { outline: 3px solid rgb(205 61 77 / 28%); outline-offset: 3px; }
.primary-action:disabled { cursor: wait; opacity: .66; }

.provider-note {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.45;
}

.notice {
  margin: 0 0 16px;
  padding: 13px 15px;
  border: 1px solid #d9d4ca;
  border-radius: 13px;
  background: var(--soft);
  font-size: .9rem;
  line-height: 1.45;
}

.notice.error { border-color: #e7bbc0; color: #882330; background: #fff5f6; }

.terms-check {
  margin: 0 0 18px;
  padding: 15px 16px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.5;
}

.terms-check[hidden] { display: none; }
.terms-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--red); }
.terms-check a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }

.project-link-note {
  margin-top: 30px;
  padding-top: 24px;
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  font-size: .92rem;
}

.project-link-note span { color: var(--muted); line-height: 1.5; }

.new-workspace { padding: clamp(10px, 3vw, 30px); }

.new-workspace h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -.035em;
}

.new-workspace > p:not(.eyebrow) {
  margin: 22px 0;
  color: var(--muted);
  line-height: 1.6;
}

.coming-soon {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.site-footer {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .site-brand { width: min(100% - 28px, 560px); }
  .login-shell {
    width: min(100% - 28px, 560px);
    padding: 18px 0 44px;
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .login-card { padding: 28px 22px; border-radius: 24px; }
  h1 { font-size: clamp(2.35rem, 13vw, 3.6rem); }
  .new-workspace { padding: 24px 10px 8px; }
}

@media (prefers-reduced-motion: no-preference) {
  .primary-action { transition: transform 140ms ease, background 140ms ease; }
  .primary-action:active { transform: translateY(1px); }
}
