:root {
  color-scheme: light;
  --ink: #171816;
  --muted: #696a65;
  --paper: #fbfaf7;
  --panel: #fff;
  --line: #dedbd4;
  --soft: #f1efe9;
  --red: #cd3d4d;
  --red-dark: #a92c3a;
  --green-soft: #e6f3ee;
  --green: #246c59;
  --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; }
button { cursor: pointer; }

.site-brand,
.site-footer,
.account-shell {
  width: min(720px, calc(100% - 40px));
  margin-inline: auto;
}

.site-brand {
  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%; }

.account-shell {
  padding: 32px 0 72px;
  align-self: center;
}

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

.eyebrow {
  margin: 0 0 12px;
  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 {
  margin: 0;
  font-size: clamp(2.35rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: -.04em;
}

.lede {
  margin: 20px 0 28px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.context-card {
  margin: 0 0 26px;
  padding: 15px 17px;
  border: 1px solid #cfe3dc;
  border-radius: 15px;
  background: var(--green-soft);
  color: #375f54;
  font-size: .91rem;
  line-height: 1.5;
}

.context-card strong { display: block; margin-bottom: 3px; color: var(--green); }

.account-form { display: grid; gap: 20px; }

.account-form > label:not(.terms-check) {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.account-form input[type="text"] {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid #cfcac1;
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  font-size: 1.05rem;
}

.account-form input:focus-visible {
  outline: 3px solid rgb(205 61 77 / 22%);
  border-color: var(--red);
}

.field-note { color: var(--muted); font-size: .84rem; font-weight: 500; line-height: 1.45; }

.terms-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  color: #444641;
  font-size: .9rem;
  line-height: 1.5;
}

.terms-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--red); }
.terms-check a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }

.primary-action,
.secondary-action {
  min-height: 54px;
  padding: 13px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 15px;
  font-weight: 800;
  text-decoration: none;
}

.primary-action {
  border: 0;
  color: #fff;
  background: var(--red);
  box-shadow: 0 12px 24px rgb(205 61 77 / 18%);
}

.primary-action:hover { background: var(--red-dark); }
.primary-action:disabled { cursor: wait; opacity: .65; }

.secondary-action {
  border: 1px solid #cfcac1;
  color: var(--ink);
  background: #fff;
}

.primary-action:focus-visible,
.secondary-action:focus-visible {
  outline: 3px solid rgb(205 61 77 / 24%);
  outline-offset: 3px;
}

.notice {
  margin: 0 0 18px;
  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; }

.account-email { margin: -14px 0 22px; color: var(--muted); font-size: .88rem; }

.workspace-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.workspace-row {
  width: 100%;
  padding: 16px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.workspace-row:hover { border-color: #c5beb4; background: #fdfcf9; }
.workspace-row.current { border-color: #e3b4ba; background: #fff7f8; }
.workspace-row:focus-visible { outline: 3px solid rgb(205 61 77 / 24%); outline-offset: 2px; }

.workspace-initials {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.workspace-copy { min-width: 0; display: grid; gap: 4px; }
.workspace-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; }
.workspace-copy span { color: var(--muted); font-size: .84rem; }
.workspace-action { color: var(--red); font-size: .84rem; font-weight: 800; }

.site-footer {
  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: 620px) {
  .site-brand,
  .site-footer,
  .account-shell { width: min(100% - 28px, 560px); }
  .account-shell { padding: 18px 0 44px; }
  .account-card { padding: 28px 22px; border-radius: 24px; }
  h1 { font-size: clamp(2.25rem, 12vw, 3.35rem); }
  .workspace-row { grid-template-columns: 44px minmax(0, 1fr); }
  .workspace-action { grid-column: 2; }
}

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