/* KAN-748 — Beta-enrollment modal.
 * Works on any page that includes /js/betaModal.js (the marketing site,
 * public profile, public rating, register, invite, etc.). Colours come from
 * tokens.css (KAN-894), which every page loads first, so the modal follows
 * the phone's light or dark setting with the page.
 */
.bm-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.bm-overlay.bm-open { display: flex; }
.bm-modal {
    background: var(--surface);
    color: var(--text);
    border-radius: 14px;
    max-width: 440px;
    width: 100%;
    padding: 28px 28px 24px;
    box-shadow: var(--shadow-hover);
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.bm-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: var(--text-subtle);
    cursor: pointer;
    padding: 4px 8px;
}
.bm-close:hover { color: var(--text); }
.bm-title {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--accent-text);
}
.bm-lede {
    margin: 0 0 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
}
.bm-field { display: block; margin: 0 0 12px; }
.bm-field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.bm-field-label .bm-optional {
    color: var(--text-subtle);
    font-weight: 500;
    font-size: 0.75rem;
}
.bm-input, .bm-select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    font-family: inherit;
}
.bm-input:focus, .bm-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus);
}
.bm-submit {
    display: block;
    width: 100%;
    margin: 14px 0 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: var(--on-accent);
    font-weight: 700;
    font-size: 1rem;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}
.bm-submit:disabled { opacity: 0.7; cursor: progress; }
.bm-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
    border-radius: 8px;
    padding: 14px 16px;
    margin: 12px 0 0;
    font-size: 0.95rem;
    line-height: 1.5;
}
.bm-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-strong);
    border-radius: 8px;
    padding: 10px 14px;
    margin: 12px 0 0;
    font-size: 0.9rem;
}
.bm-fine {
    margin: 14px 0 0;
    font-size: 0.78rem;
    color: var(--text-subtle);
    line-height: 1.5;
}
.bm-overlay [hidden] { display: none !important; }

/* KAN-763 — two-step group-join flow (replaces the email form). */
.bm-account-note {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 18px;
    font-size: 0.88rem;
    line-height: 1.5;
}
.bm-step {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 0 0 12px;
}
.bm-step2 {
    border-color: var(--success-border);
    background: var(--bg-accent);
}
.bm-step-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 0.98rem;
    color: var(--text);
    margin: 0 0 10px;
}
.bm-step-head--next::before {
    content: '\25B8'; /* ▸ subtle "next step" chevron */
    color: var(--accent-text);
    font-weight: 700;
    margin-right: 2px;
}
.bm-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 0.8rem;
    font-weight: 800;
    flex: 0 0 auto;
}
.bm-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
}
.bm-btn-primary {
    /* Darker gradient than the brand green so white text clears WCAG AA
       (white on #16A34A is only ~3.3:1; on #15803D→#166534 it's 5:1–7:1). */
    background: linear-gradient(135deg, var(--accent-strong), var(--accent-deep));
    /* !important defeats host-page anchor color rules — these buttons are <a>
       elements and some surfaces (e.g. register.html) colour links brand-green,
       which rendered the label green-on-green. */
    color: var(--on-accent) !important;
    font-weight: 800;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28); /* color-ok: shade under white text on solid green, same in both modes */
}
.bm-btn-ghost {
    background: var(--surface);
    border: 1px solid var(--accent);
    color: var(--accent-text) !important;
    margin-top: 10px;
}
.bm-step1-confirm { margin-top: 12px; }
.bm-confirm-msg {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    line-height: 1.45;
}
