/* Sign-in and initial setup share one quiet, responsive entry point. */
html:has(.auth-page), .auth-page { min-height: 100%; }
.auth-page { overflow: auto; background: var(--paper); }
.auth-page #app { min-height: 100vh; min-height: 100svh; }
.auth-page .auth-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 21px; font-weight: 750; letter-spacing: -.8px; }
.auth-page .auth-brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; background: #e5eee7; color: #173d32; }
.auth-page .auth-brand-mark img { display: block; width: 31px; height: 31px; object-fit: contain; }
.auth-page .auth-brand-name > span { font-weight: 500; }
.auth-page .auth-brand-inverse { color: #fff; }
.auth-page .auth-brand-inverse .auth-brand-mark { background: #d5eadb; color: #173d32; }
.auth-page .field-label { text-transform: none; font-size: 13px; font-weight: 650; letter-spacing: 0; color: var(--ink-soft); margin-bottom: 8px; }
.auth-page .input { height: 52px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); font-size: 14px; transition: border-color .18s, box-shadow .18s; }
.auth-page .input::placeholder { color: var(--muted-soft); }
.auth-page .input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-page .field-help { color: var(--muted); font-size: 12px; line-height: 1.65; margin-top: 7px; }
.auth-page .pw-wrap { position: relative; display: flex; }
.auth-page .pw-wrap .input { padding-right: 70px; }
.auth-page .pw-reveal { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 11px; display: flex; align-items: center; color: var(--muted); border-radius: 8px; font-size: 12px; font-weight: 650; }
.auth-page .pw-reveal:hover { color: var(--ink); background: var(--surface-2); }
.auth-page .submit-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 12px 18px; border-radius: 12px; background: var(--accent-fill); color: var(--on-accent); font-size: 14px; font-weight: 650; text-decoration: none; transition: background .18s, transform .18s; }
.auth-page .submit-btn:hover { background: var(--accent-hover); text-decoration: none; }
.auth-page .submit-btn:disabled { opacity: .65; cursor: wait; }
.auth-page .submit-btn .spinner { border-color: rgba(255,255,255,.25); border-top-color: #fff; }
.auth-page .err, .auth-page .success { padding: 13px 15px; border: 1px solid var(--tint-danger-line); border-radius: 12px; background: var(--tint-danger); color: var(--danger); font-size: 13px; line-height: 1.6; }
.auth-page .success { background: var(--tint-success); border-color: var(--tint-success-line); color: var(--tint-success-ink); }
.auth-page button:focus-visible, .auth-page a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

/* A distinct front door, with room for the form at every viewport height. */
.login-page #app { display: grid; grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr); gap: 24px; padding: 24px; }
.login-page .showcase { position: relative; display: flex; flex-direction: column; min-height: 690px; padding: 35px clamp(28px, 4.2vw, 68px) 34px; border-radius: 28px; overflow: hidden; background: #173d32; color: #fff; }
.login-page .stage { display: flex; flex: 1; flex-direction: column; justify-content: center; padding-top: 56px; }
.login-page .showcase-eyebrow { color: #b5d2c2; font-size: 12px; font-weight: 600; margin-bottom: 18px; }
.login-page .showcase h1 { max-width: 13ch; margin: 0; font-family: var(--font-display); font-weight: 550; font-size: clamp(38px, 4vw, 60px); line-height: 1.09; letter-spacing: -2.7px; }
.login-page .showcase h1 span { color: #d5eadb; }
.login-page .showcase-lede { max-width: 31ch; margin: 20px 0 0; color: #c0d5ca; font-size: 14px; line-height: 1.8; }
.login-page .workspace-art { position: relative; flex: 1; display: grid; place-items: center; min-height: 260px; margin: 4px -22px 16px; }
.login-page .workspace-art img { display: block; width: 100%; max-height: 360px; object-fit: contain; mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 86%, transparent), linear-gradient(to right, transparent, #000 12%, #000 88%, transparent); mask-composite: intersect; }
.login-page .suite { display: flex; flex-wrap: wrap; gap: 9px; }
.login-page .suite .item { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; background: rgba(255,255,255,.07); border: 1px solid rgba(213,234,219,.12); border-radius: 9px; color: #d5eadb; font-size: 11px; }
.login-page .showcase-footer { margin: 21px 0 0; color: #b5ccbe; font-size: 11px; }
.login-page .form-panel { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 48px clamp(28px, 5vw, 82px); }
.login-page .form-inner { width: 100%; max-width: 400px; margin: auto; }
.login-page .mark-compact { display: none; margin-bottom: 42px; }
.login-page .suite-compact { display: none; color: var(--muted); font-size: 12px; margin: -28px 0 34px; }
.login-page .form-eyebrow { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; margin-bottom: 27px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 11px; }
.login-page .form-eyebrow span { overflow: hidden; text-overflow: ellipsis; }
.login-page .form-eyebrow svg { flex: none; }
.login-page .form-title { margin: 0 0 12px; color: var(--ink); font-family: var(--font-display); font-size: clamp(30px, 3vw, 39px); font-weight: 650; line-height: 1.2; letter-spacing: -1.4px; }
.login-page .form-sub { margin: 0 0 32px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.login-page .form-fields { display: flex; flex-direction: column; gap: 21px; margin: 0; }
.login-page .form-fields > p { margin: 0; }
.login-page .form-fields .submit-btn { margin-top: 4px; }
.login-page .form-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; font-size: 12px; }
.login-page .form-row-end { justify-content: center; }
.login-page .form-row a { color: var(--accent-ink); font-weight: 600; }
.login-page .form-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 52px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.login-page .form-footer .footer-note { display: inline-flex; align-items: center; gap: 5px; }
.login-page .fade-in { animation: auth-enter .45s ease-out both; }
@keyframes auth-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

/* Setup is a guided workspace launch, with the whole route always visible. */
.setup-page #app { display: grid; place-items: center; padding: 36px 24px; }
.setup-page .setup-shell { display: grid; grid-template-columns: 330px minmax(0, 1fr); width: 100%; max-width: 1030px; min-height: 650px; border: 1px solid var(--line); border-radius: 26px; overflow: hidden; background: var(--surface); box-shadow: 0 20px 70px rgba(23,61,50,.07); }
.setup-page .setup-rail { display: flex; flex-direction: column; padding: 35px 32px 28px; background: #173d32; color: #fff; }
.setup-page .setup-intro { margin: 54px 0 34px; }
.setup-page .setup-intro h2 { margin: 0 0 14px; font-family: var(--font-display); font-weight: 550; font-size: 32px; line-height: 1.2; letter-spacing: -1.1px; }
.setup-page .setup-intro h2 span { color: #d5eadb; }
.setup-page .setup-intro p { margin: 0; color: #c0d5ca; font-size: 13px; line-height: 1.8; }
.setup-page .setup-steps { display: flex; flex-direction: column; gap: 25px; list-style: none; padding: 0; margin: 0; }
.setup-page .setup-step { position: relative; display: flex; align-items: center; gap: 13px; color: #b0c9bb; }
.setup-page .setup-step:not(:last-child)::after { content: ''; position: absolute; top: 38px; left: 16px; height: 16px; border-left: 1px solid rgba(213,234,219,.22); }
.setup-page .setup-step-marker { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(213,234,219,.28); border-radius: 11px; font-size: 12px; font-weight: 650; }
.setup-page .setup-step.current { color: #fff; }
.setup-page .setup-step.current .setup-step-marker { color: #173d32; background: #d5eadb; border-color: #d5eadb; box-shadow: 0 0 0 4px rgba(213,234,219,.09); }
.setup-page .setup-step.done .setup-step-marker { color: #d5eadb; background: rgba(213,234,219,.08); }
.setup-page .setup-step-name { display: block; font-size: 13px; font-weight: 600; }
.setup-page .setup-step-desc { display: block; margin-top: 3px; color: #b0c9bb; font-size: 11px; }
.setup-page .setup-rail-footer { margin: auto 0 0; padding-top: 42px; color: #b0c9bb; font-size: 11px; line-height: 1.6; }
.setup-page .setup-content { display: flex; flex-direction: column; justify-content: center; padding: 48px 56px; min-width: 0; }
.setup-page .setup-content .eyebrow { display: block; margin-bottom: 16px; color: var(--accent-ink); text-transform: none; font-size: 12px; font-weight: 650; letter-spacing: 0; }
.setup-page h1 { margin: 0 0 12px; color: var(--ink); font-family: var(--font-display); font-size: 30px; line-height: 1.25; font-weight: 650; letter-spacing: -1px; }
.setup-page .sub { margin: 0 0 28px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.setup-page .steps { display: flex; gap: 7px; margin-bottom: 28px; }
.setup-page .step-pip { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .2s; }
.setup-page .step-pip.done { background: var(--accent); }
.setup-page .step-pip.current { background: var(--accent); }
.setup-page .fields { display: flex; flex-direction: column; gap: 18px; }
.setup-page .actions { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; gap: 12px; }
.setup-page .actions .btn { min-height: 48px; padding: 0 20px; border-radius: 11px; font-size: 13px; font-weight: 650; }
.setup-page .err { margin-top: 20px; }
.setup-page .checkbox { display: flex; gap: 13px; align-items: flex-start; cursor: pointer; padding: 17px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.setup-page .checkbox input { flex: none; width: 17px; height: 17px; accent-color: var(--accent); margin: 2px 0 0; }
.setup-page .checkbox .label { color: var(--ink); font-size: 13px; font-weight: 650; }
.setup-page .checkbox .desc { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 5px; }
.setup-page .email-field { display: flex; min-width: 0; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.setup-page .email-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.setup-page .email-field .input { min-width: 60px; flex: 1; width: 100%; border: 0; background: transparent; box-shadow: none; }
.setup-page .email-domain { display: flex; align-items: center; max-width: 65%; min-width: 0; padding: 0 13px; border-left: 1px solid var(--line); border-radius: 0 11px 11px 0; background: var(--surface-2); color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.setup-page .recap { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 7px 20px; font-size: 12px; }
.setup-page .recap .row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 14px 0; }
.setup-page .recap .row + .row { border-top: 1px solid var(--line); }
.setup-page .recap .k { color: var(--muted); flex: none; }
.setup-page .recap .v { color: var(--ink); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.setup-page .setup-success-icon { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 24px; border-radius: 19px; background: var(--accent-soft); color: var(--accent-ink); }

@media (min-width: 981px) and (max-height: 760px) {
  .login-page .showcase { min-height: 620px; }
  .login-page .stage { padding-top: 32px; }
  .login-page .workspace-art { min-height: 220px; }
  .login-page .workspace-art img { max-height: 270px; }
  .login-page .showcase h1 { font-size: 44px; }
}
@media (max-width: 1100px) {
  .setup-page .setup-shell { grid-template-columns: 290px minmax(0, 1fr); }
  .setup-page .setup-rail { padding: 32px 26px; }
  .setup-page .setup-content { padding: 40px 36px; }
}
@media (max-width: 980px) {
  .login-page #app { display: flex; justify-content: center; padding: 0; }
  .login-page .showcase { display: none; }
  .login-page .form-panel { width: 100%; padding: 48px 30px; }
  .login-page .mark-compact { display: inline-flex; }
  .login-page .suite-compact { display: block; }
  .login-page .form-inner { max-width: 430px; }
}
@media (max-width: 740px) {
  .setup-page #app { display: block; padding: 16px; }
  .setup-page .setup-shell { display: block; min-height: 0; border-radius: 20px; }
  .setup-page .setup-rail { padding: 24px; }
  .setup-page .setup-intro, .setup-page .setup-rail-footer { display: none; }
  .setup-page .setup-steps { flex-direction: row; gap: 10px; margin-top: 24px; }
  .setup-page .setup-step { flex: 1; flex-direction: column; align-items: flex-start; gap: 9px; }
  .setup-page .setup-step:not(:last-child)::after { top: 16px; left: 44px; width: calc(100% - 42px); height: 0; border-left: 0; border-top: 1px solid rgba(213,234,219,.22); }
  .setup-page .setup-step-name { font-size: 10px; }
  .setup-page .setup-step-desc { display: none; }
  .setup-page .setup-content { padding: 30px 24px; }
  .setup-page h1 { font-size: 26px; }
}
@media (max-width: 440px) {
  .login-page .form-panel { padding: 32px 24px; }
  .login-page .form-footer { margin-top: 36px; }
  .login-page .footer-note { display: none !important; }
  .login-page .form-row { flex-wrap: wrap; gap: 13px; }
  .setup-page #app { padding: 10px; }
  .setup-page .setup-content { padding: 28px 20px; }
  .setup-page .recap { padding: 4px 14px; }
  .setup-page .recap .row { flex-direction: column; gap: 5px; }
  .setup-page .recap .v { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-page *, .auth-page *::before, .auth-page *::after { animation: none !important; transition: none !important; }
}
