/* credential.css: Litofane identity for the auth.litofane.com credential pages
   (PRO-371, DEC-0182, DEC-0145/DEC-0149). Self-hosted fonts only (DEC-0115). */

/* --- @font-face: self-hosted, same-origin (no CSP change needed) --- */

/* Barlow Semi Condensed 600 */
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/barlow-sc-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/barlow-sc-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow Semi Condensed 700 */
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/barlow-sc-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/barlow-sc-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow Semi Condensed 800 */
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/barlow-sc-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/barlow-sc-800-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* DM Sans 400-700 (variable weight, single file per subset) */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Sagewold (LITOFANE wordmark) */
@font-face {
  font-family: 'Sagewold';
  src: url('fonts/Sagewold-Regular.ttf') format('truetype');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* --- Reset --- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* --- Custom properties --- */

:root {
  --ink: #0a0a0b;
  --ink-muted: #6b6b73;
  --ink-secondary: #8a8a92;
  --ink-panel: #adadb4;
  --teal: #00b4a6;
  --teal-hover: #009a8e;
  --teal-active: #007e74;
  --surface: #ffffff;
  --surface-alt: #f4f4f5;
  --surface-card: #fafafa;
  --border: #c9c9ce;
  --border-light: #dcdcdf;
  --panel-bg: #0a0a0b;
  --panel-fg: #ffffff;
  --red: #b91c1c;
  --red-bg: #fff5f5;
  --red-border: #fca5a5;
  --green: #15803d;
  --green-bg: #dcfce7;
  --green-border: #86efac;
  --radius: 4px;
  --radius-lg: 8px;
}

/* --- Base --- */

html, body { height: 100%; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--teal-active); }

/* --- Split-screen shell --- */

/* Fixed-viewport shell: the brand panel is nailed to the viewport and the
   form column scrolls internally (PRO-397 layout fix). */
.acc-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

/* --- Brand panel (left) --- */

/* Brand panel stretches to the fixed shell height (PRO-397 layout fix). */
.acc-aside {
  width: 44%;
  flex: none;
  background: var(--panel-bg);
  color: var(--panel-fg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  overflow: hidden;
}

.acc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.acc-mark { display: block; }

.acc-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.acc-copy { max-width: 400px; }

.acc-copy img { height: 38px; width: auto; display: block; }

.acc-copy h1 {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-weight: 800;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 30px 0 0;
  color: var(--panel-fg);
}

.acc-copy p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-panel);
  margin: 18px 0 0;
  max-width: 360px;
}

.acc-brandfoot {
  font-size: 12px;
  color: var(--ink-muted);
}

/* --- Form panel (right) --- */

/* Form panel scrolls internally so its height changes never affect the
   shell or the brand panel (PRO-397 layout fix). */
.acc-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 32px;
  height: 100%;
  overflow-y: auto;
}

/* --- LITOFANE.sales wordmark --- */

.acc-wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: 'Sagewold', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.acc-wordmark span { color: var(--teal); }

/* --- Subtitle --- */

.acc-subtitle {
  font-size: 14px;
  color: var(--ink-muted);
  margin: 10px 0 22px;
}

/* --- Tab bar (cross-page links between /signin and /signup) --- */

.acc-tabs {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  gap: 2px;
  width: 100%;
  margin-bottom: 22px;
}

.acc-tabs a {
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms, color 120ms, box-shadow 120ms;
  background: transparent;
  color: var(--ink-muted);
}

.acc-tabs a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(10, 10, 11, 0.06);
}

.acc-tabs a:hover:not(.active) {
  color: var(--ink);
}

/* --- Legacy layout (header + page + card) --- */

header {
  display: none;
}

.header-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.page {
  display: flex;
  justify-content: center;
  padding: 48px 24px;
}

/* --- Card (form container) --- */

.card {
  width: 100%;
  max-width: 400px;
}

h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--ink);
}

/* --- Form fields --- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
}

input[type="email"],
input[type="password"],
input[type="text"],
select {
  display: block;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  height: 40px;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}

select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b6b73' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

input:focus, select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--teal);
}

input.invalid, select.invalid { border-color: var(--red); }

/* --- Buttons --- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--teal);
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms;
}

.btn-primary:hover:not(:disabled) { background: var(--teal-hover); }
.btn-primary:active:not(:disabled) { background: var(--teal-active); }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

/* Submit-button loading spinner (item 4, PRO-383). A CSS-only spinner shown
   while the is-loading class is present; the ::before pseudo-element coexists
   with the button's textContent swap, so no innerHTML change is needed. White
   on the disabled grey (#9ca3af) button for contrast. */
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
.btn-primary.is-loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms;
}

.btn-secondary:hover:not(:disabled) { background: var(--surface-alt); }
.btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Error and success boxes --- */

.error-box {
  display: none;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--red);
  margin-bottom: 16px;
}

.success-box {
  display: none;
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--green);
  line-height: 1.5;
}

/* --- Checkbox --- */

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.checkbox-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.checkbox-field span,
.checkbox-field label {
  font-size: 14px;
  color: var(--ink-muted);
  font-weight: 400;
  line-height: 1.4;
}

/* --- Beta opt-in card (PRO-397 reframe) --- */

.beta-optin-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  background: var(--surface-alt);
  margin-bottom: 16px;
}

.beta-optin-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.beta-optin-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  cursor: pointer;
}

.beta-optin-sub {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.45;
  margin-top: 4px;
}

/* --- Role picker (PRO-397 role picker) --- */

.role-picker {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* Margin-based spacing instead of gap so collapsing buttons can animate
   their spacing to zero (PRO-397 motion polish). */
.role-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.role-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  max-height: 60px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.2s ease, max-height 0.22s ease, margin 0.22s ease, padding 0.22s ease, border-width 0.22s ease;
}

.role-col .role-btn:last-child { margin-bottom: 0; }

.role-btn.is-collapsing {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;
  pointer-events: none;
}

.role-btn:hover {
  border-color: var(--ink-muted);
  background: var(--surface-alt);
}

.role-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.role-btn.selected {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 480px) {
  .role-picker {
    flex-direction: column;
  }
}

/* --- reCAPTCHA --- */

.recaptcha-container {
  margin-bottom: 16px;
}

/* --- Reset-password section (inline in signin) --- */

.reset-section {
  display: none;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.reset-section .field { margin-bottom: 12px; }

.reset-success {
  display: none;
  font-size: 14px;
  color: var(--ink-muted);
  margin-top: 10px;
}

/* --- Forgot link --- */

.forgot-link {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
}

.forgot-link button {
  background: transparent;
  border: none;
  color: var(--teal);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.forgot-link button:hover { text-decoration: underline; }

/* --- Footer link --- */

.footer-link {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-muted);
}

.footer-link a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.footer-link a:hover { text-decoration: underline; }

/* --- Click-wrap (first-login acceptance, DEC-0116 / DEC-0159) --- */

.clickwrap-intro {
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}


/* Registration click-wrap container on signup (PRO-396). */
#registration-clickwrap {
  margin-bottom: 16px;
}

/* Inline document links inside the accept-checkbox label (PRO-407). */
#registration-clickwrap a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Password-criteria widget (PRO-396) --- */

.password-criteria-list {
  list-style: none;
  margin: 8px 0 0;
  column-count: 2;
  column-gap: 18px;
  column-rule: 0.5px solid var(--border);
}

.criterion {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  line-height: 1.6;
  break-inside: avoid;
  margin-bottom: 4px;
}

/* Tick/cross indicator via ::before pseudo-element (flex child, centred). */
.criterion::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: border-color 120ms, background 120ms;
}

/* Unmet state: muted text, empty circle. */
.criterion.unmet {
  color: var(--ink-muted);
}

/* Met state: teal filled circle, ink text. */
.criterion.met {
  color: var(--ink);
}

.criterion.met::before {
  border-color: var(--teal);
  background: var(--teal);
}

/* --- Account page --- */

#back-link {
  margin-bottom: 16px;
}

#actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

/* --- Two-column grid (signup company + role) --- */

.acc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* --- SSO footer line --- */

.acc-sso-note {
  font-size: 12.5px;
  color: var(--ink-muted);
  text-align: center;
  margin: 2px 0 0;
}

/* --- Responsive: mobile breakpoint (matches mockup at 760px) --- */

@media (max-width: 760px) {
  html, body { height: auto; }

  .acc-shell {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .acc-main {
    height: auto;
    overflow: visible;
  }

  .acc-aside {
    width: 100%;
    padding: 22px 24px 26px;
  }

  .acc-brandfoot { display: none; }
  .acc-mark { display: none; }
  .acc-top { justify-content: flex-end; }

  .acc-copy h1 {
    font-size: 30px;
    margin-top: 18px;
  }

  .acc-copy p {
    font-size: 14px;
    margin-top: 12px;
    max-width: none;
  }

  .acc-copy { max-width: none; }

  .acc-main {
    padding: 28px 24px 46px;
    align-items: flex-start;
  }

  .acc-grid { grid-template-columns: 1fr; }
}

/* Narrow-screen fallback: single-column criteria on small phones. */
@media (max-width: 360px) {
  .password-criteria-list { column-count: 1; }
}
