/* Client Craft Identity: small extensions on top of the vendored web kit (cc/web/clientcraft-web.css).
   Kit tokens only; no raw brand values. Dashboard chrome rules mirror spec §2.2 until the kit ships .cc-dash. */

.cc-auth-logo { display: block; width: auto; height: 32px; }
.cc-auth-logo-link { display: inline-flex; border-radius: var(--cc-radius-sm); }
.cc-auth-split { min-height: 100dvh; }
.cc-auth-split > .cc-auth { min-height: 100dvh; background: var(--cc-color-surface); }
.cc-auth-split .cc-auth__card { box-shadow: none; border-color: transparent; padding-inline: var(--cc-space-4); }
@media (max-width: 900px) {
  .cc-auth-split > .cc-auth { background: var(--cc-color-canvas); }
  .cc-auth-split .cc-auth__card { box-shadow: var(--cc-shadow-3); border-color: var(--cc-color-border); padding-inline: var(--cc-space-8); }
}
@media (max-width: 560px) { .cc-auth-split .cc-auth__card { padding-inline: var(--cc-space-5); } }

/* Quiet brand panel (no raster artwork). */
.cc-auth-brand { gap: var(--cc-space-6); border-left: 1px solid var(--cc-color-border-subtle); }
.cc-auth-brand__title { max-width: 26ch; }
.cc-auth-brand__list { display: grid; gap: var(--cc-space-4); margin: 0; padding: 0; list-style: none; color: var(--cc-color-text-muted); }
.cc-auth-brand__list li { display: flex; gap: var(--cc-space-3); align-items: flex-start; }
.cc-auth-brand__list svg { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--cc-color-accent); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cc-auth-brand__logos:empty { display: none; }

/* Header language picker: a real form that still works without JavaScript. */
.cc-language { display: flex; align-items: center; gap: var(--cc-space-2); }
.cc-language select { min-height: 44px; padding: 0 var(--cc-space-3); border: 1px solid var(--cc-color-border); border-radius: var(--cc-radius-sm); background: var(--cc-color-surface); }
.cc-js .cc-language button { display: none; }

.cc-auth__footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--cc-space-2) var(--cc-space-4); }
.cc-auth__footer a { color: inherit; }
.cc-auth__links { display: grid; gap: var(--cc-space-3); justify-items: center; text-align: center; font-size: var(--cc-text-small); color: var(--cc-color-text-muted); }
.cc-auth__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--cc-color-accent-soft); color: var(--cc-color-accent); }
.cc-auth__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cc-auth__icon--success { background: var(--cc-color-success-bg); color: var(--cc-color-success-fg); }
.cc-auth__icon--warning { background: var(--cc-color-warning-bg); color: var(--cc-color-warning-fg); }
.cc-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Password field with a reveal button (enhancement; hidden until the script runs). */
.cc-password { position: relative; display: flex; }
.cc-password .cc-input { flex: 1; padding-right: 52px; }
.cc-password__toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--cc-radius-sm); background: transparent; color: var(--cc-color-text-muted); cursor: pointer; }
.cc-password__toggle:hover { color: var(--cc-color-text); }
.cc-password__toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.cc-password__toggle[aria-pressed="true"] { color: var(--cc-color-accent); }

/* Live strength checklist: a visible check, not colour alone. */
.cc-strength { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--cc-space-1) var(--cc-space-3); margin: 0; padding: 0; list-style: none; font-size: var(--cc-text-small); color: var(--cc-color-text-muted); }
.cc-strength li { display: flex; gap: var(--cc-space-2); align-items: center; }
.cc-strength li::before { content: ""; flex: none; width: 14px; height: 14px; border: 1.5px solid var(--cc-color-border-strong); border-radius: 50%; }
.cc-strength li.is-met { color: var(--cc-color-success-fg); }
.cc-strength li.is-met::before { content: "✓"; display: grid; place-items: center; border-color: var(--cc-color-success-fg); background: var(--cc-color-success-bg); font-size: 10px; font-weight: 700; line-height: 1; }
@media (max-width: 420px) { .cc-strength { grid-template-columns: 1fr; } }

/* One-time code. */
.cc-otp { font-variant-numeric: tabular-nums; letter-spacing: 0.4em; font-size: 1.375rem; text-align: center; }

/* Live waiting status on "Check your inbox". */
.cc-live { display: flex; align-items: center; gap: var(--cc-space-3); padding: var(--cc-space-3) var(--cc-space-4); border-radius: var(--cc-radius-md); background: var(--cc-color-surface-sunken); font-size: var(--cc-text-small); color: var(--cc-color-text-muted); }
.cc-live__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--cc-color-accent); box-shadow: 0 0 0 0 var(--cc-color-accent-soft); animation: cc-pulse 1.6s var(--cc-motion-ease-standard, ease) infinite; }
.cc-live[data-state="verified"] .cc-live__dot { background: var(--cc-color-success-fg); animation: none; }
.cc-live[data-state="expired"] .cc-live__dot { background: var(--cc-color-warning-fg); animation: none; }
@keyframes cc-pulse { 0% { box-shadow: 0 0 0 0 var(--cc-color-accent-soft-hover, rgba(49, 84, 244, .3)); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Busy submit buttons keep their label ("Signing in…") and show a small spinner. */
.cc-button[aria-busy="true"] { cursor: progress; }
.cc-button[aria-busy="true"]::before { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: cc-spin .8s linear infinite; }
@keyframes cc-spin { to { transform: rotate(360deg); } }

/* "Reference ••••1A2B [Copy reference]" instead of raw support codes. */
.cc-reference { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cc-space-2); font-size: var(--cc-text-caption); color: var(--cc-color-text-subtle); }
.cc-reference .cc-button { min-height: 32px; }

/* ---------- Account & security inside the dashboard chrome (spec §2.2, §2.9) ---------- */
.cc-dash { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; background: var(--cc-color-canvas); }
.cc-dash__nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: var(--cc-space-6); height: 100dvh; padding: var(--cc-space-6) var(--cc-space-4); background: var(--cc-color-surface); border-right: 1px solid var(--cc-color-border-subtle); overflow-y: auto; }
.cc-dash__nav ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.cc-nav-item { display: flex; align-items: center; gap: var(--cc-space-3); min-height: 40px; padding: 0 var(--cc-space-3); border-radius: var(--cc-radius-sm); color: var(--cc-color-text-muted); font-weight: 500; text-decoration: none; }
.cc-nav-item:hover { background: var(--cc-color-surface-hover); color: var(--cc-color-text); text-decoration: none; }
.cc-nav-item[aria-current="page"] { background: var(--cc-color-accent-soft); color: var(--cc-color-accent-soft-fg); font-weight: 600; }
.cc-nav-item svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cc-org-switcher { display: flex; align-items: center; justify-content: space-between; gap: var(--cc-space-2); min-height: 48px; padding: var(--cc-space-2) var(--cc-space-3); border: 1px solid var(--cc-color-border); border-radius: var(--cc-radius-md); color: var(--cc-color-text); font-weight: 600; text-decoration: none; }
.cc-org-switcher:hover { border-color: var(--cc-color-accent-line); text-decoration: none; }
.cc-dash__spacer { flex: 1; }
.cc-dash__main { min-width: 0; }
.cc-dash__topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--cc-space-4); min-height: 64px; padding: 0 var(--cc-space-8); background: var(--cc-color-surface); border-bottom: 1px solid var(--cc-color-border-subtle); }
.cc-dash__content { max-width: 1184px; padding: var(--cc-space-8); display: grid; gap: var(--cc-space-6); }
.cc-user-menu { position: relative; }
.cc-user-menu summary { display: flex; align-items: center; gap: var(--cc-space-2); min-height: 44px; padding: 0 var(--cc-space-2); border-radius: var(--cc-radius-pill); cursor: pointer; list-style: none; }
.cc-user-menu summary::-webkit-details-marker { display: none; }
.cc-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--cc-color-accent-soft); color: var(--cc-color-accent-soft-fg); font-size: var(--cc-text-caption); font-weight: 700; }
.cc-user-menu__panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: 2px; min-width: 240px; padding: var(--cc-space-2); background: var(--cc-color-surface); border: 1px solid var(--cc-color-border); border-radius: var(--cc-radius-md); box-shadow: var(--cc-shadow-3); }
.cc-user-menu__who { padding: var(--cc-space-2) var(--cc-space-3); border-bottom: 1px solid var(--cc-color-border-subtle); font-size: var(--cc-text-small); overflow-wrap: anywhere; }
.cc-user-menu__panel a, .cc-user-menu__panel button { display: flex; align-items: center; min-height: 40px; padding: 0 var(--cc-space-3); border: 0; border-radius: var(--cc-radius-sm); background: none; color: var(--cc-color-text); text-align: left; text-decoration: none; cursor: pointer; }
.cc-user-menu__panel a:hover, .cc-user-menu__panel button:hover { background: var(--cc-color-surface-hover); text-decoration: none; }
.cc-tabs { display: flex; flex-wrap: wrap; gap: var(--cc-space-1); border-bottom: 1px solid var(--cc-color-border); }
.cc-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--cc-space-3); border-bottom: 2px solid transparent; color: var(--cc-color-text-muted); font-weight: 600; text-decoration: none; }
.cc-tabs a:hover { color: var(--cc-color-text); text-decoration: none; }
.cc-tabs a[aria-current="page"] { border-bottom-color: var(--cc-color-accent); color: var(--cc-color-text); }
.cc-setting-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cc-space-3); padding: var(--cc-space-4) 0; border-top: 1px solid var(--cc-color-border-subtle); }
.cc-setting-row:first-of-type { border-top: 0; }
.cc-setting-row dt { font-weight: 600; }
.cc-setting-row dd { margin: 0; color: var(--cc-color-text-muted); overflow-wrap: anywhere; }
.cc-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--cc-space-2); margin: 0; padding: var(--cc-space-4); list-style: none; background: var(--cc-color-surface-sunken); border-radius: var(--cc-radius-md); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cc-qr { width: 200px; max-width: 100%; padding: var(--cc-space-3); background: #fff; border: 1px solid var(--cc-color-border); border-radius: var(--cc-radius-md); }
.cc-qr svg { display: block; width: 100%; height: auto; }
.cc-key { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cc-toast { position: fixed; right: var(--cc-space-6); bottom: var(--cc-space-6); z-index: 30; max-width: min(420px, calc(100vw - 32px)); }
@media (max-width: 920px) {
  .cc-dash { grid-template-columns: 1fr; }
  .cc-dash__nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: var(--cc-space-3) var(--cc-space-4); border-right: 0; border-bottom: 1px solid var(--cc-color-border-subtle); }
  .cc-dash__nav ul { display: flex; flex-wrap: wrap; }
  .cc-dash__spacer, .cc-dash__nav .cc-org-switcher { display: none; }
  .cc-dash__topbar { padding: 0 var(--cc-space-4); }
  .cc-dash__content { padding: var(--cc-space-5) var(--cc-space-4); }
}
@media (max-width: 420px) { .cc-codes { grid-template-columns: 1fr; } }
