/**
 * TTFC User Preferences - Frontend styles (save button + register prompt + toast)
 * RTL, brand-aligned (var(--primary-color-daat), var(--text-color)), accessible.
 */

.ttfc-prefs-actions {
    display: flex;
    justify-content: flex-end;
    margin: 1.5rem 0 1rem;
    direction: rtl;
}

.ttfc-prefs-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid rgba(15, 43, 91, 0.25);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-color-daat, #0f2b5b);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 100ms ease;
    font-family: inherit;
    line-height: 1.2;
}

.ttfc-prefs-save-btn:hover,
.ttfc-prefs-save-btn:focus-visible {
    background: rgba(15, 43, 91, 0.06);
    border-color: var(--primary-color-daat, #0f2b5b);
    outline: none;
}

.ttfc-prefs-save-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(15, 43, 91, 0.18);
}

.ttfc-prefs-save-btn:active {
    transform: scale(0.97);
}

.ttfc-prefs-save-btn.is-saved {
    background: var(--primary-color-daat, #0f2b5b);
    color: #fff;
    border-color: var(--primary-color-daat, #0f2b5b);
}

.ttfc-prefs-save-btn.is-saved:hover,
.ttfc-prefs-save-btn.is-saved:focus-visible {
    background: #0a1f44;
}

.ttfc-prefs-save-btn[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.ttfc-prefs-icon {
    flex-shrink: 0;
}

/* ---------- Toast ---------- */
.ttfc-prefs-toast {
    position: fixed;
    bottom: 1.5rem;
    inset-inline-start: 1.5rem;
    inset-inline-end: auto;
    background: var(--primary-color-daat, #0f2b5b);
    color: #fff;
    padding: 0.75rem 1.1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    direction: rtl;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease;
    max-width: 320px;
}

.ttfc-prefs-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ttfc-prefs-toast.is-error {
    background: #b00020;
}

@media (prefers-reduced-motion: reduce) {
    .ttfc-prefs-toast,
    .ttfc-prefs-save-btn {
        transition: none;
    }
}

/* ---------- Register-invite modal (matches ttfc-comments-manager 1.2.0) ---------- */
.ttfc-prefs-register-prompt-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 43, 91, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    direction: rtl;
    animation: ttfc-prefs-fade 180ms ease-out;
}

.ttfc-prefs-register-prompt-dialog {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 2rem 1.75rem 1.5rem;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
    text-align: center;
    direction: rtl;
    outline: none;
    animation: ttfc-prefs-pop 200ms ease-out;
}

.ttfc-prefs-register-prompt-close {
    position: absolute;
    top: 0.5rem;
    inset-inline-start: 0.5rem;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    color: var(--text-color, #333);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: background 150ms ease, opacity 150ms ease;
}

.ttfc-prefs-register-prompt-close:hover,
.ttfc-prefs-register-prompt-close:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    opacity: 1;
    outline: none;
}

.ttfc-prefs-register-prompt-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(15, 43, 91, 0.08);
    color: var(--primary-color-daat, #0f2b5b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ttfc-prefs-register-prompt-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text-color, #333);
}

.ttfc-prefs-register-prompt-intro {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color, #333);
    margin: 0 0 1rem;
    opacity: 0.9;
}

.ttfc-prefs-register-prompt-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    text-align: start;
    color: var(--text-color, #333);
}

.ttfc-prefs-register-prompt-benefits li {
    position: relative;
    padding-inline-start: 1.4rem;
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
    line-height: 1.55;
}

.ttfc-prefs-register-prompt-benefits li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color-daat, #0f2b5b);
}

.ttfc-prefs-register-prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.ttfc-prefs-register-prompt-cta {
    display: inline-block;
    text-decoration: none;
    padding: 0.65rem 1.2rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    background: var(--primary-color-daat, #0f2b5b);
    color: #fff;
    border: 1px solid var(--primary-color-daat, #0f2b5b);
    transition: background 150ms ease;
}

.ttfc-prefs-register-prompt-cta:hover,
.ttfc-prefs-register-prompt-cta:focus-visible {
    color: #fff;
    text-decoration: none;
    background: #0a1f44;
    outline: none;
}

.ttfc-prefs-register-prompt-dismiss {
    background: transparent;
    border: 1px solid rgba(15, 43, 91, 0.2);
    color: var(--primary-color-daat, #0f2b5b);
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 150ms ease;
}

.ttfc-prefs-register-prompt-dismiss:hover,
.ttfc-prefs-register-prompt-dismiss:focus-visible {
    background: rgba(15, 43, 91, 0.06);
    outline: none;
}

.ttfc-prefs-register-prompt-dontshow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-color, #333);
    opacity: 0.85;
    cursor: pointer;
}

body.ttfc-prefs-register-prompt-open {
    overflow: hidden;
}

@keyframes ttfc-prefs-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes ttfc-prefs-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .ttfc-prefs-register-prompt-overlay,
    .ttfc-prefs-register-prompt-dialog {
        animation: none;
    }
}

@media (max-width: 600px) {
    .ttfc-prefs-toast {
        inset-inline-start: 1rem;
        inset-inline-end: 1rem;
        max-width: none;
    }
}
