/* Signing in, signing up and joining a team (templates/auth/*.html), in the
   Stella design system (Midnight). Tokens: css/stella/tokens.css. Components
   (buttons, fields, alerts): css/stella/components.css. */

body.auth { min-height: 100vh; background: var(--color-bg-base); font-size: 15px; line-height: 22px; }
.auth-skip { position: absolute; left: -9999px; top: 0; }
.auth-skip:focus { left: var(--space-4); top: var(--space-4); z-index: 10; padding: var(--space-2) var(--space-3);
  background: var(--color-bg-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }

/* Logo A: colours by role, so it reads on light and on dark. */
.lk-star { fill: var(--logo-star, var(--color-midnight)); }
.lk-word { fill: var(--logo-word, var(--color-midnight)); }
.lk-face { fill: var(--logo-face, #FFFFFF); }

.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); min-height: 100vh; }

/* ---------------------------------------------------------------- the form side */
.auth-pane { display: flex; flex-direction: column; min-width: 0; padding: var(--space-6) clamp(20px, 5vw, 64px); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 40px; }
.auth-logo { display: inline-flex; border-radius: var(--radius-sm); }
.auth-logo svg { display: block; width: 112px; height: auto; }
.auth-top-link { font-size: 14px; color: var(--color-text-secondary); }
.auth-top-link a { font-weight: 600; margin-left: var(--space-1); }
.auth-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: var(--space-10); }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; }
.auth-foot { font-size: 13px; color: var(--color-text-tertiary); }

.auth-title { margin: 0 0 var(--space-2); font-family: var(--font-display); font-size: 32px; line-height: 38px; font-weight: 600;
  letter-spacing: -0.02em; text-wrap: balance; color: var(--color-text-primary); }
.auth-lead { margin: 0 0 var(--space-6); color: var(--color-text-secondary); font-size: 15px; line-height: 23px; }
.auth-lead strong { color: var(--color-text-primary); font-weight: 600; }
.auth-flashes { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
.auth-flashes a { color: inherit; font-weight: 600; }

.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth-card .form-control { height: var(--size-control-lg); font-size: 15px; padding: 0 var(--space-4); }
.auth-card .form-label { font-size: 14px; line-height: 18px; }
.auth-card .form-text, .auth-hint { margin: 0; font-size: 13px; line-height: 18px; color: var(--color-text-secondary); }
.auth-optional { font-weight: 400; color: var(--color-text-tertiary); }
.auth-card .invalid-feedback, .auth-error { margin: 0; font-size: 13px; line-height: 18px; color: var(--color-danger-text); }
.auth-ok { margin: 0; font-size: 13px; line-height: 18px; color: var(--color-success-text); }
.auth-wide { width: 100%; }
.auth-card .btn-lg { height: 48px; font-size: 15px; border-radius: var(--radius-lg); }

/* The 6-digit code: big, spaced, easy to check against the email. */
.auth-code { text-align: center; letter-spacing: 0.4em; font-size: 24px !important; font-weight: 600;
  font-variant-numeric: tabular-nums; height: 56px !important; }

/* The help centre address: the name, then the fixed domain. */
.auth-address { display: flex; align-items: stretch; height: var(--size-control-lg); background: var(--color-bg-input);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); overflow: hidden; }
.auth-address:focus-within { outline: 2px solid var(--color-border-focus); outline-offset: 1px; border-color: var(--color-border-focus); }
.auth-address.is-invalid { border-color: var(--color-danger); }
.auth-address.is-valid { border-color: var(--color-success); }
.auth-address-input { flex: 1 1 auto; min-width: 0; padding: 0 0 0 var(--space-4); border: 0; outline: none; background: transparent;
  font: inherit; font-size: 15px; color: var(--color-text-primary); }
.auth-address-domain { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; padding: 0 var(--space-4) 0 2px;
  color: var(--color-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.auth-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--color-border); font-size: 14px;
  color: var(--color-text-secondary); }
.auth-actions form { margin: 0; }
.auth-actions a, .auth-link-btn { color: var(--color-text-link); font-weight: 600; }
.auth-link-btn { height: auto; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; }
.auth-note { margin: var(--space-5) 0 0; font-size: 13px; line-height: 19px; color: var(--color-text-tertiary); }
.auth-note a { font-weight: 600; }

/* Sign-up steps */
.auth-progress { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2); }
.auth-progress li { display: flex; flex-direction: column; gap: var(--space-2); font-size: 12px; line-height: 16px; font-weight: 600;
  color: var(--color-text-tertiary); }
.auth-progress-bar { height: 4px; border-radius: var(--radius-full); background: var(--color-border); }
.auth-progress li.done .auth-progress-bar, .auth-progress li.current .auth-progress-bar { background: var(--color-midnight); }
.auth-progress li.current { color: var(--color-text-primary); }
.auth-progress li.done { color: var(--color-text-secondary); }

/* Who you are joining (the invite page) */
.auth-join { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); padding: var(--space-4);
  border-radius: var(--radius-lg); background: var(--color-ai-surface); border: 1px solid var(--color-ai-border); }
.auth-join-mark { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  border-radius: var(--radius-lg); background: var(--color-midnight); color: #FFFFFF; font-weight: 600; font-size: 18px; }
.auth-join b { display: block; font-size: 15px; }
.auth-join small { display: block; font-size: 13px; color: var(--color-text-secondary); }
.auth-readonly { display: flex; align-items: center; height: var(--size-control-lg); padding: 0 var(--space-4); border-radius: var(--radius-md);
  background: var(--color-bg-sunken); border: 1px solid var(--color-border); color: var(--color-text-secondary); font-size: 15px; }

/* ---------------------------------------------------------------- the night sky side */
.auth-side { position: relative; overflow: hidden; background: var(--color-midnight); color: #FFFFFF;
  --logo-star: var(--color-starlight); --logo-word: #FFFFFF; }
.auth-side .sky { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--color-starlight); pointer-events: none; }
.auth-side .st-star { --st-face: var(--color-midnight); }
.auth-side .st-star .st-body { fill: var(--color-starlight); }
.auth-side-in { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: var(--space-5);
  max-width: 480px; margin: 0 auto; padding: var(--space-16) clamp(24px, 4vw, 56px); }
.auth-side-star { filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35)); }
.auth-side-star .st-star { width: 104px; height: 104px; }
.auth-side-title { margin: 0; font-family: var(--font-display); font-size: 40px; line-height: 1.08; font-weight: 600; letter-spacing: -0.025em;
  text-wrap: balance; }
.auth-side-sub { margin: 0; font-size: 17px; line-height: 1.55; color: #C9C8F4; }
.auth-side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); font-size: 16px; color: #E4E3FA; }
.auth-side-list li { display: flex; align-items: flex-start; gap: var(--space-3); }
.auth-side-list li::before { content: ''; flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--color-starlight); }

/* A card floating on the sky: a draft, or the help centre preview. */
.auth-mock { padding: var(--space-4); border-radius: var(--radius-xl); background: #FFFFFF; color: var(--color-text-primary);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.3); border: 1px solid var(--color-ai-border); font-size: 14px; line-height: 21px; }
.auth-mock p { margin: var(--space-2) 0 var(--space-3); }
.auth-mock .st-star { --st-face: #FFFFFF; }
.auth-mock .st-star .st-body { fill: var(--color-midnight); }
.auth-mock-label { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; font-weight: 600; color: var(--color-ai-text); }
.auth-mock-label span { font-weight: 500; color: var(--color-text-secondary); }
.auth-mock-label .st-star { width: 18px; height: 18px; }
.auth-mock-btns { display: flex; gap: var(--space-2); }
.auth-mock-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 var(--space-3); border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong); font-size: 12.5px; font-weight: 600; }
.auth-mock-btn.primary { background: var(--color-midnight); border-color: var(--color-midnight); color: #FFFFFF; }

.hc-preview { padding: 0; overflow: hidden; }
.hc-preview-bar { display: flex; align-items: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-3); background: #F1F1EE;
  border-bottom: 1px solid #E2E2DE; }
.hc-preview-bar i { width: 9px; height: 9px; border-radius: 50%; background: #D3D3CE; }
.hc-preview-url { flex: 1; min-width: 0; margin-left: var(--space-2); height: 24px; display: flex; align-items: center; padding: 0 var(--space-3);
  border-radius: var(--radius-sm); background: #FFFFFF; border: 1px solid #E2E2DE; font-size: 12.5px; color: var(--color-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-preview-url b { color: var(--color-text-primary); font-weight: 600; }
.hc-preview-hero { padding: var(--space-6) var(--space-5); background: var(--color-midnight); color: #FFFFFF; }
.hc-preview-hero strong { display: block; font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 600; }
.hc-preview-search { margin-top: var(--space-3); height: 36px; display: flex; align-items: center; padding: 0 var(--space-3);
  border-radius: var(--radius-md); background: #FFFFFF; color: var(--color-text-tertiary); font-size: 13px; }
.hc-preview-rows { padding: var(--space-4) var(--space-5); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.hc-preview-rows span { height: 34px; border-radius: var(--radius-md); background: var(--color-bg-sunken); border: 1px solid var(--color-border); }

/* ---------------------------------------------------------------- small screens: the form only */
@media (max-width: 900px) {
  .auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .auth-pane { padding: var(--space-5) var(--space-4); }
  .auth-main { justify-content: flex-start; padding-block: var(--space-8); }
  .auth-title { font-size: 28px; line-height: 34px; }
}

/* Demo sign-in (demo.py): development only. */
.auth-demo { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--color-border); }
.auth-demo h2 { margin: 0; font-size: 15px; font-weight: 600; }
.auth-demo p { margin: 4px 0 var(--space-3); font-size: 13px; color: var(--color-text-secondary); }
.auth-demo-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.auth-demo-btns form { margin: 0; }
.auth-demo-btns .btn { height: auto; min-height: 52px; padding: 8px; flex-direction: column; gap: 2px; line-height: 1.2; }
.auth-demo-btns .btn b { font-size: 13.5px; }
.auth-demo-btns .btn small { font-size: 12px; font-weight: 400; color: var(--color-text-secondary); }
@media (max-width: 420px) { .auth-demo-btns { grid-template-columns: minmax(0, 1fr); } }
