/* Checkmate identity across sign-in, registration and account recovery. */
html[data-theme] body.cm-auth {
    --auth-page: #FFFFFF;
    --auth-surface: #FFFFFF;
    --auth-soft: #F6F5F1;
    --auth-text: #151719;
    --auth-muted: #69706D;
    --auth-border: #E4E5DF;
    --auth-link: #8B671D;
    --auth-focus: #B18A33;
    --auth-success: #186340;
    --auth-error: #B33037;
    --text: var(--auth-text);
    --text-soft: var(--auth-muted);
    --text-muted: var(--auth-muted);
    --panel-border: var(--auth-border);
    --field-text: var(--auth-text);
    --theme-input: var(--auth-surface);
    margin: 0;
    padding: 0;
    min-height: 100svh;
    color: var(--auth-text) !important;
    background: var(--auth-page) !important;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

html[data-theme="midnight"] body.cm-auth,
html[data-theme="dark"] body.cm-auth {
    --auth-page: #151719;
    --auth-surface: #151719;
    --auth-soft: #202326;
    --auth-text: #F6F5F1;
    --auth-muted: #ADB2AD;
    --auth-border: #383D3C;
    --auth-link: #E0BF73;
    --auth-focus: #D8B45C;
    --auth-success: #8AD4AA;
    --auth-error: #FFB1AD;
}

.cm-auth *, .cm-auth *::before, .cm-auth *::after { box-sizing: border-box; }
.cm-auth-shell { display: grid; grid-template-columns: minmax(350px, .9fr) minmax(420px, 1.1fr); min-height: 100svh; }
.cm-auth-brand {
    display: flex;
    position: sticky;
    top: 0;
    align-self: start;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100svh;
    max-height: 1080px;
    padding: clamp(32px, 4.2vw, 72px);
    background: radial-gradient(ellipse at 10% 50%, rgba(216,180,92,.075), transparent 66%), #0D0F11;
    color: #F6F5F1;
    overflow: hidden;
}
.cm-auth-lockup { display: flex; align-items: center; gap: 13px; width: fit-content; color: #F6F5F1 !important; text-decoration: none !important; }
.cm-auth-lockup img { width: 42px; height: 49px; object-fit: contain; flex-shrink: 0; }
.cm-auth-lockup strong { display: block; font-size: 27px; line-height: 1.15; font-weight: 650; letter-spacing: -.9px; }
.cm-auth-lockup small { display: block; color: #D8B45C; font-size: 9px; font-weight: 550; letter-spacing: 3.1px; margin-top: 6px; }
.cm-auth-story { position: relative; margin: 56px 0 64px; }
.cm-auth-hero-mark { display: block; width: 116px; height: 135px; object-fit: contain; margin-bottom: 36px; }
.cm-auth-brand-kicker { color: #D8B45C !important; font-size: 10px; letter-spacing: 2px; font-weight: 650; margin: 0 0 18px; }
.cm-auth-story h2 { margin: 0; font-size: clamp(32px, 3.7vw, 58px); line-height: 1.1; font-weight: 550; letter-spacing: -2.1px; }
html[data-theme] .cm-auth-story h2 { color: #F6F5F1 !important; }
.cm-auth-brand-copy { max-width: 35ch; margin: 24px 0 0; color: #AEB2AD !important; font-size: 15px; line-height: 1.8; }
.cm-auth-tagline { padding-top: 22px; margin: 0; border-top: 1px solid #373329; font-size: 10px; font-weight: 500; line-height: 1.8; letter-spacing: 1.15px; color: #D8B45C !important; }
.cm-auth-tagline span { margin: 0 8px; }
.cm-auth-panel { display: flex; justify-content: center; align-items: center; min-width: 0; padding: 72px clamp(28px, 5.8vw, 100px); background: var(--auth-page); }
.cm-auth-card { width: 100%; max-width: 420px; min-width: 0; margin: 0; padding: 0; background: var(--auth-surface); }
.cm-auth--register .cm-auth-panel { align-items: flex-start; padding-top: 72px; padding-bottom: 72px; }
.cm-auth--register .cm-auth-card { max-width: 620px; }
.cm-auth-form-kicker { margin: 0 0 20px !important; color: var(--auth-link) !important; font-size: 10px !important; font-weight: 700; letter-spacing: 1.8px; }
.cm-auth-card h1 { margin: 0; color: var(--auth-text) !important; font-size: clamp(30px, 3vw, 40px); font-weight: 600; letter-spacing: -1.4px; line-height: 1.15; }
.cm-auth-card > p:not(.cm-auth-form-kicker) { margin: 14px 0 0; color: var(--auth-muted); font-size: 14px; line-height: 1.75; }
.cm-auth-card > form, .cm-auth-card > .form { margin-top: 34px; }
.cm-auth .field { display: block; margin: 0 0 20px; }
.cm-auth .field > label { display: block; color: var(--auth-text); font-size: 12px; font-weight: 650; margin-bottom: 9px; }
.cm-auth input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.cm-auth textarea, .cm-auth select {
    appearance: none;
    width: 100%;
    height: 52px;
    min-width: 0;
    border: 1px solid var(--auth-border) !important;
    border-radius: 10px;
    padding: 0 15px;
    background: var(--auth-surface) !important;
    color: var(--auth-text) !important;
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.cm-auth textarea { min-height: 88px; padding-top: 13px; resize: vertical; }
.cm-auth input::placeholder, .cm-auth textarea::placeholder { color: var(--auth-muted); opacity: .85; }
.cm-auth input:not([type="radio"]):not([type="checkbox"]):focus,
.cm-auth textarea:focus, .cm-auth select:focus { border-color: var(--auth-focus) !important; box-shadow: 0 0 0 3px rgba(216,180,92,.16); }
.cm-auth .field small, .cm-auth .hint { display: block; color: var(--auth-muted); font-size: 11px; line-height: 1.6; margin: 8px 0 0; }
.cm-auth .hint { margin: -10px 0 20px; }
.cm-auth button { font: inherit; cursor: pointer; }
.cm-auth .login-button, .cm-auth .register-button, .cm-auth button[type="submit"], .cm-auth .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin-top: 7px;
    border-radius: 10px;
    border: 1px solid #D8B45C !important;
    background: #D8B45C !important;
    color: #151719 !important;
    padding: 13px 18px;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 700;
    text-decoration: none;
    box-shadow: none !important;
    transition: background .15s ease, border-color .15s ease;
}
.cm-auth .login-button:hover, .cm-auth .register-button:hover, .cm-auth button[type="submit"]:hover, .cm-auth .button:hover { background: #E5C577 !important; border-color: #E5C577 !important; transform: none; }
.cm-auth button:disabled { cursor: wait; opacity: .6; }
.cm-auth a { color: var(--auth-link); font-weight: 600; text-decoration: none; }
.cm-auth a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cm-auth a:focus-visible, .cm-auth button:focus-visible { outline: 3px solid var(--auth-focus); outline-offset: 4px; }
.cm-auth .forgot-row, .cm-auth .form-meta { display: flex; justify-content: flex-end; margin: 15px 0 0; }
.cm-auth .form-meta { margin: -4px 0 18px; }
.cm-auth .forgot-link { font-size: 12px; }
.cm-auth .info-note { margin-top: 26px; padding: 16px 0 0; border-top: 1px solid var(--auth-border); color: var(--auth-muted); font-size: 12px; line-height: 1.8; }
.cm-auth .link-row, .cm-auth .footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; font-size: 12px; line-height: 1.7; color: var(--auth-muted); }
.cm-auth .footer-links { justify-content: space-between; padding-top: 8px; }
.cm-auth #msg { min-height: 0; margin: 14px 0 0; color: var(--auth-error); font-size: 12px; line-height: 1.7; }
.cm-auth #msg:empty { display: none; }
.cm-auth #msg.success, .cm-auth .match-indicator.ok { color: var(--auth-success); }
.cm-auth .message, .cm-auth .error:not(.match-indicator) { display: none; margin: 22px 0 0; padding: 13px 15px; border-radius: 9px; font-size: 12px; line-height: 1.65; }
.cm-auth .message { background: color-mix(in srgb, var(--auth-success) 8%, var(--auth-surface)); border: 1px solid color-mix(in srgb, var(--auth-success) 25%, transparent); color: var(--auth-success); }
.cm-auth .error:not(.match-indicator) { background: color-mix(in srgb, var(--auth-error) 7%, var(--auth-surface)); border: 1px solid color-mix(in srgb, var(--auth-error) 25%, transparent); color: var(--auth-error); }
.cm-auth .error.cm-auth-server-error { display: block; }
.cm-auth .password-wrap { position: relative; }
.cm-auth .password-wrap input { padding-right: 53px !important; }
.cm-auth .toggle-password { display: flex; align-items: center; justify-content: center; position: absolute; right: 5px; top: 5px; width: 42px; height: 42px; padding: 0; border: none; background: transparent; color: var(--auth-muted); border-radius: 7px; }
.cm-auth .toggle-password:hover { color: var(--auth-text); background: var(--auth-soft); }
.cm-auth .toggle-password svg { width: 20px; height: 20px; }
.cm-auth .match-indicator { min-height: 0; color: var(--auth-muted); font-size: 12px; line-height: 1.5; margin: -8px 0 18px; }
.cm-auth .match-indicator.error { color: var(--auth-error); }
.cm-auth .actions { display: flex; flex-direction: column; gap: 8px; margin-top: 26px; }
.cm-auth .button.button--ghost { background: var(--auth-surface) !important; border-color: var(--auth-border) !important; color: var(--auth-text) !important; }
.cm-auth .button.button--ghost:hover { background: var(--auth-soft) !important; }

/* Choice controls remain real buttons/radios, with clear selected states. */
.cm-auth .mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.cm-auth .mode-card { position: relative; text-align: left; padding: 17px; border: 1px solid var(--auth-border); border-radius: 11px; background: var(--auth-surface); color: var(--auth-text); }
.cm-auth .mode-card:hover { border-color: var(--auth-focus); }
.cm-auth .mode-card.active { border-color: var(--auth-focus); background: color-mix(in srgb, #D8B45C 9%, var(--auth-surface)); box-shadow: inset 0 0 0 1px var(--auth-focus); }
.cm-auth .mode-card__title { margin: 0 0 7px; font-size: 12px; line-height: 1.4; font-weight: 700; }
.cm-auth .mode-card__copy { margin: 0; color: var(--auth-muted); font-size: 11px; line-height: 1.65; }
.cm-auth .account-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cm-auth .plan-grid { display: grid; gap: 8px; }
.cm-auth .account-type-card, .cm-auth .plan-card { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 13px; border: 1px solid var(--auth-border); border-radius: 10px; cursor: pointer; background: var(--auth-surface); }
.cm-auth .account-type-card:has(input:checked), .cm-auth .plan-card:has(input:checked) { border-color: var(--auth-focus); background: color-mix(in srgb, #D8B45C 8%, var(--auth-surface)); }
.cm-auth .account-type-card.disabled { opacity: .5; cursor: not-allowed; }
.cm-auth input[type="radio"], .cm-auth input[type="checkbox"] { flex: 0 0 auto; accent-color: #8B671D; width: 16px; height: 16px; margin: 2px 0 0; }
.cm-auth .account-type-card__title, .cm-auth .plan-card__title { display: block; font-size: 12px; font-weight: 700; line-height: 1.6; }
.cm-auth .account-type-card__copy, .cm-auth .plan-card__copy { display: block; margin-top: 4px; font-size: 10px; font-weight: 400; line-height: 1.7; color: var(--auth-muted); }
.cm-auth .hidden { display: none !important; }
.cm-auth #createFields, .cm-auth #joinFields { border-top: 1px solid var(--auth-border); margin-top: 25px; padding-top: 25px; }

/* Clear completion state for account registration, without exposing account identifiers. */
.cm-registration-success-dialog {
    width: min(500px, calc(100vw - 32px));
    max-height: calc(100svh - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--auth-text);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}
.cm-registration-success-dialog:not([open]) { display: none; }
.cm-registration-success-dialog::backdrop { background: rgba(8, 10, 10, .68); backdrop-filter: blur(3px); }
.cm-registration-success-dialog__surface {
    padding: 30px;
    border: 1px solid var(--auth-border);
    border-radius: 18px;
    background: var(--auth-surface);
}
.cm-registration-success-dialog__brand {
    display: flex;
    align-items: center;
    gap: 11px;
}
.cm-registration-success-dialog__brand img {
    width: 38px;
    height: 45px;
    object-fit: contain;
}
.cm-registration-success-dialog__brand strong {
    display: block;
    color: var(--auth-text);
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -.6px;
}
.cm-registration-success-dialog__brand small {
    display: block;
    margin-top: 3px;
    color: var(--auth-link);
    font-size: 8px;
    font-weight: 650;
    letter-spacing: 2.2px;
}
.cm-registration-success-dialog__kicker {
    margin: 28px 0 13px;
    color: var(--auth-link);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
}
.cm-registration-success-dialog h2 {
    margin: 0;
    color: var(--auth-text);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -1px;
    line-height: 1.15;
}
.cm-registration-success-dialog__message,
.cm-registration-success-dialog__detail {
    margin: 16px 0 0;
    color: var(--auth-text);
    font-size: 14px;
    line-height: 1.7;
}
.cm-registration-success-dialog__detail {
    padding: 14px 15px;
    border: 1px solid color-mix(in srgb, var(--auth-focus) 32%, var(--auth-border));
    border-radius: 10px;
    background: color-mix(in srgb, #D8B45C 8%, var(--auth-surface));
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.65;
}
.cm-registration-success-dialog__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 25px;
}
.cm-auth .cm-registration-success-dialog .cm-registration-success-dialog__primary {
    width: auto;
    min-height: 48px;
    margin: 0;
    padding: 12px 14px;
    text-align: center;
}
.cm-auth .cm-registration-success-dialog__secondary {
    min-height: 48px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: var(--auth-surface);
    color: var(--auth-text);
    font-size: 12px;
    font-weight: 650;
}
.cm-auth .cm-registration-success-dialog__secondary:hover { background: var(--auth-soft); }
.cm-auth .cm-registration-success-dialog__secondary:focus-visible {
    outline: 3px solid var(--auth-focus);
    outline-offset: 3px;
}

@media (min-width: 1500px) {
    .cm-auth-brand { padding-left: max(64px, calc((100vw - 1360px) / 2)); }
}
@media (max-height: 760px) and (min-width: 861px) {
    .cm-auth-brand { padding-top: 32px; padding-bottom: 28px; }
    .cm-auth-story { margin: 32px 0; }
    .cm-auth-hero-mark { width: 82px; height: 95px; margin-bottom: 22px; }
    .cm-auth-story h2 { font-size: clamp(30px, 3.7vw, 46px); }
    .cm-auth-brand-copy { margin-top: 18px; font-size: 13px; }
    .cm-auth-panel { padding-top: 48px; padding-bottom: 48px; }
}
@media (max-width: 1080px) {
    .cm-auth-shell { grid-template-columns: minmax(290px, .82fr) minmax(380px, 1.18fr); }
    .cm-auth-brand { padding: 32px; }
    .cm-auth-story h2 { font-size: 37px; letter-spacing: -1.3px; }
    .cm-auth-panel { padding-left: 36px; padding-right: 36px; }
    .cm-auth--register .account-type-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .cm-auth-shell { display: block; }
    .cm-auth-brand { position: relative; min-height: 0; height: auto; padding: 26px 28px 24px; gap: 21px; }
    .cm-auth-lockup img { width: 34px; height: 40px; }
    .cm-auth-lockup strong { font-size: 24px; }
    .cm-auth-lockup small { font-size: 8px; letter-spacing: 2.8px; }
    .cm-auth-story { display: none; }
    .cm-auth-tagline { margin: 0; padding-top: 14px; font-size: 9px; }
    .cm-auth-panel, .cm-auth--register .cm-auth-panel { min-height: 0; padding: 44px 28px 80px; }
    .cm-auth-card h1 { font-size: 33px; }
    .cm-auth-form-kicker { margin-bottom: 16px !important; }
    .cm-auth--register .account-type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    html[data-theme] .cm-auth .cm-theme-picker--floating { top: 25px; right: 25px; }
    html[data-theme] .cm-auth .cm-theme-trigger { width: 42px; min-width: 42px; padding: 10px !important; gap: 0; justify-content: center; }
    html[data-theme] .cm-auth .cm-theme-trigger__copy,
    html[data-theme] .cm-auth .cm-theme-trigger__chevron { display: none; }
    html[data-theme] .cm-auth .cm-theme-menu { max-width: calc(100vw - 50px); }
    .cm-auth .mode-grid { grid-template-columns: 1fr; gap: 9px; }
    .cm-auth .mode-card { padding: 14px 16px; }
    .cm-auth--register .account-type-grid { grid-template-columns: 1fr; }
    .cm-auth .account-type-card, .cm-auth .plan-card { padding: 12px 14px; }
    .cm-auth .account-type-card__copy { font-size: 11px; }
    .cm-registration-success-dialog__surface { padding: 25px; }
    .cm-registration-success-dialog__actions { grid-template-columns: 1fr; }
    .cm-auth-tagline { letter-spacing: .65px; }
    .cm-auth-tagline span { margin: 0 4px; }
}
@media (prefers-reduced-motion: reduce) {
    .cm-auth *, .cm-auth *::before, .cm-auth *::after { scroll-behavior: auto !important; transition: none !important; }
}
