/* Exam switch (CP1c) — shared component, linked directly by any signed-in page
   that offers switching. Own file rather than folded into a page bundle,
   matching how signup-modal.css is treated: it belongs to the component, not
   to any one page. `tsw-` prefix so it can never collide with a page's styles. */

/* Trigger — hidden until the server confirms this account may switch, so a
   paid user is never shown an option that would only refuse them. */
[data-test-switch] {
    display: none;
}

[data-test-switch].tsw-ready {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #b8860b;
    text-decoration: underline;
    cursor: pointer;
}

[data-test-switch].tsw-ready:hover {
    color: #d4a017;
}

/* Overlay + shell */
.tsw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tsw-overlay.visible {
    display: flex;
}

.tsw-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.tsw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #edf2f7;
}

.tsw-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.tsw-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.tsw-close:hover {
    color: #4a5568;
}

.tsw-body {
    padding: 24px;
}

.tsw-lead {
    font-size: 0.92rem;
    color: #4a5568;
    margin: 0 0 14px;
    line-height: 1.5;
}

/* The destination, stated once and unmissably — this is the whole point of
   the confirmation. */
.tsw-target {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a202c;
    background: #fffbf0;
    border: 1px solid #f0e0b6;
    border-left: 3px solid #d4a017;
    border-radius: 6px;
    padding: 12px 14px;
    margin: 0 0 14px;
}

.tsw-note {
    font-size: 0.82rem;
    color: #718096;
    line-height: 1.5;
    margin: 0 0 16px;
}

.tsw-agree {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.86rem;
    color: #4a5568;
    line-height: 1.45;
    cursor: pointer;
    margin-bottom: 4px;
}

.tsw-agree input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #d4a017;
}

.tsw-error {
    color: #e53e3e;
    font-size: 0.8rem;
    margin: 8px 0 0;
}

.tsw-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
}

.tsw-btn {
    padding: 11px 18px;
    background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.tsw-btn:hover {
    opacity: 0.92;
}

.tsw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tsw-btn-ghost {
    padding: 11px 16px;
    background: none;
    border: none;
    color: #718096;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
}

.tsw-btn-ghost:hover {
    color: #4a5568;
}

/* Mobile: bottom sheet, matching the signup modal's behavior at this width. */
@media (max-width: 480px) {
    .tsw-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .tsw-modal {
        max-width: 100%;
        border-radius: 14px 14px 0 0;
    }

    .tsw-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .tsw-btn,
    .tsw-btn-ghost {
        width: 100%;
        text-align: center;
    }
}
