/* Legal modals: privacy policy & terms (landing, registration, forgot password) */

.sw-privacy-modal[hidden] {
    display: none !important;
}

.sw-privacy-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 16px;
    box-sizing: border-box;
}

.sw-privacy-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.sw-privacy-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 42rem);
    max-height: min(88vh, 720px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.2),
        0 8px 20px rgba(15, 23, 42, 0.1);
    border: 1px solid rgba(203, 213, 225, 0.95);
}

.sw-privacy-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(241, 245, 249, 0.95);
    color: #475569;
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.sw-privacy-modal__close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.sw-privacy-modal__close:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.sw-privacy-modal__body {
    overflow: auto;
    padding: 22px 22px 24px;
    -webkit-overflow-scrolling: touch;
}

.sw-privacy-modal__brand {
    margin-bottom: 12px;
}

.sw-privacy-modal__logo {
    width: 88px;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: contain;
}

.sw-privacy-modal__h1 {
    margin: 0 0 12px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.25;
    padding-right: 36px;
}

.sw-privacy-modal__lead {
    margin: 0 0 16px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #475569;
}

.sw-privacy-modal__body p {
    margin: 0 0 12px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #334155;
}

.sw-privacy-modal__h2 {
    margin: 18px 0 8px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.sw-privacy-modal__h2:first-of-type {
    margin-top: 14px;
}

.sw-privacy-modal__list {
    margin: 4px 0 12px;
    padding-left: 1.2rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #334155;
}

.sw-privacy-modal__list li {
    margin-bottom: 6px;
}

body.sw-legal-modal-open {
    overflow: hidden;
}

/* Triggers styled as normal text links */
.lp-site-footer-links button[data-legal-modal-open] {
    margin: 0;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #1e3a5f;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

.lp-site-footer-links button[data-legal-modal-open]:hover {
    color: #0f172a;
    text-decoration: underline;
}

.sw-onboard-footer-links button.sw-onboard-topbar-link[data-legal-modal-open] {
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.sw-onboard-footer-links button.sw-onboard-topbar-link[data-legal-modal-open]:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

button.sw-onboard-topbar-link[data-legal-modal-open] {
    appearance: none;
    -webkit-appearance: none;
}

.forgot-legal button[data-legal-modal-open] {
    margin: 0;
    padding: 0;
    font: inherit;
    font-size: inherit;
    line-height: inherit;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.forgot-legal button[data-legal-modal-open]:hover {
    color: #2563eb;
    text-decoration: underline;
}

.sw-privacy-modal__subtitle-inline {
    display: block;
    margin-top: 6px;
    font-size: 0.85em;
    font-weight: 700;
    color: #64748b;
}

/*
 * Clinic registration: T&C overlays (gate + before payment) — compact card UI
 */

.sw-reg-tcs-gate {
    z-index: 10500;
}

.sw-reg-tcs-gate__backdrop {
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.sw-reg-pay-tcs-modal {
    z-index: 10600;
}

.sw-reg-pay-tcs-modal__backdrop {
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.sw-reg-tcs-gate .sw-reg-tcs-card__dialog.sw-reg-tcs-gate__dialog,
.sw-reg-pay-tcs-modal .sw-reg-tcs-card__dialog.sw-reg-pay-tcs-modal__dialog {
    width: min(100%, 40rem);
    max-height: min(90vh, 760px);
    padding: 0;
    overflow: hidden;
    border-radius: 26px;
    border: none;
    box-shadow:
        0 32px 90px rgba(15, 23, 42, 0.32),
        0 14px 40px rgba(15, 23, 42, 0.14),
        0 4px 10px rgba(15, 23, 42, 0.06);
    background: #fff;
}

.sw-reg-tcs-card__inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
}

.sw-reg-tcs-card__header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 22px 24px 16px;
    flex-shrink: 0;
}

.sw-reg-tcs-card__logo {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: block;
    border-radius: 14px;
    object-fit: contain;
}

.sw-reg-tcs-card__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #0f172a;
    line-height: 1.3;
}

.sw-reg-tcs-card__meta {
    margin: 6px 0 0;
    font-size: 0.8125rem;
    color: #94a3b8;
    line-height: 1.35;
}

.sw-reg-tcs-card__eyebrow {
    margin: 10px 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #64748b;
    font-weight: 600;
}

.sw-reg-tcs-card__scroll-shell {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}

.sw-reg-tcs-card__scroll {
    overflow-y: auto;
    max-height: min(52vh, 420px);
    padding: 0 24px 16px;
    -webkit-overflow-scrolling: touch;
}

.sw-reg-tcs-card__scroll-inner .sw-reg-tcs-card__lead {
    margin: 0 0 14px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #475569;
}

.sw-reg-tcs-card__fade {
    pointer-events: none;
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 0;
    height: 56px;
    background: linear-gradient(to top, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
}

.sw-reg-tcs-card__scroll-inner p {
    margin: 0 0 11px;
    font-size: 0.875rem;
    line-height: 1.62;
    color: #475569;
}

.sw-reg-tcs-card__scroll-inner .sw-privacy-modal__h2 {
    margin: 16px 0 8px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.015em;
}

.sw-reg-tcs-card__scroll-inner .sw-privacy-modal__list {
    margin: 4px 0 12px;
    font-size: 0.84375rem;
    line-height: 1.52;
}

.sw-reg-tcs-card__footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px 22px;
    border-top: 1px solid #f1f5f9;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 20%, #fff 70%);
}

.sw-reg-tcs-card__consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    flex: 1 1 14rem;
    margin: 0;
    padding: 4px 0;
    font: inherit;
    user-select: none;
}

.sw-reg-tcs-card__checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    margin: 0;
    flex-shrink: 0;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.sw-reg-tcs-card__checkbox:checked {
    border-color: var(--color-primary-700);
    background-color: var(--color-primary-700);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.8 8.2l2.9 3.1 6.5-6.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px auto;
}

.sw-reg-tcs-card__checkbox:focus-visible {
    outline: 2px solid var(--color-primary-400);
    outline-offset: 3px;
}

.sw-reg-tcs-card__consent-label {
    font-size: 0.875rem;
    line-height: 1.45;
    color: #64748b;
    font-weight: 500;
    padding-top: 1px;
}

.sw-reg-tcs-card__footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sw-reg-tcs-card__btn-decline {
    padding: 10px 16px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    border-radius: 10px;
    transition: color 0.15s ease, background 0.15s ease;
}

.sw-reg-tcs-card__btn-decline:hover {
    color: #1e293b;
    background: rgba(148, 163, 184, 0.12);
}

.sw-reg-tcs-card__btn-decline:focus-visible {
    outline: 2px solid var(--color-primary-400);
    outline-offset: 2px;
}

.sw-reg-tcs-card__btn-accept {
    min-height: 2.75rem;
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text-on-primary);
    cursor: pointer;
    background: var(--color-primary-700);
    box-shadow: none;
    transition: background var(--transition-fast), opacity var(--transition-fast);
}

.sw-reg-tcs-card__btn-accept:not(:disabled):hover {
    background: var(--color-primary-600);
}

.sw-reg-tcs-card__btn-accept:not(:disabled):active {
    background: var(--color-primary-800);
}

.sw-reg-tcs-card__btn-accept:focus-visible:not(:disabled) {
    outline: 2px solid var(--color-primary-400);
    outline-offset: 2px;
}

.sw-reg-tcs-card__btn-accept:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 519px) {
    .sw-reg-tcs-card__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .sw-reg-tcs-card__footer-actions {
        justify-content: flex-end;
        width: 100%;
    }

    .sw-reg-tcs-card__btn-accept {
        flex: 1 1 auto;
        justify-content: center;
    }

    .sw-reg-tcs-card__scroll {
        max-height: min(44vh, 360px);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.sw-register-tcs-pending .sw-onboard-shell,
    body.sw-register-pay-tcs-pending .sw-onboard-shell {
        filter: none;
    }
}

body.sw-register-tcs-pending {
    overflow: hidden;
}

body.sw-register-tcs-pending .sw-onboard-shell {
    filter: saturate(0.92) brightness(0.98);
}

body.sw-register-pay-tcs-pending {
    overflow: hidden;
}

body.sw-register-pay-tcs-pending .sw-onboard-shell {
    filter: saturate(0.92) brightness(0.98);
}
