/* AgeSync — Overlay Styles
   Uses CSS variables set inline by PHP:
   --agesync-accent, --agesync-btn, --agesync-bg
*/

/* ── Overlay backdrop ── */
#agesync-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background-color: color-mix(in srgb, var(--agesync-bg, #22262A) 75%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Card ── */
#agesync-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 460px;
    animation: agesync-fadeup 0.3s ease both;
}

/* ── Top disclaimer banner ── */
.agesync-top-disclaimer {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    background: linear-gradient(135deg, var(--agesync-disclaimer-color, #f97316) 0%, rgba(255, 255, 255, 0.12) 100%);
    color: #ffffff;
    border-radius: 16px;
    padding: 18px 18px 16px;
    margin-bottom: 20px;
}

.agesync-top-disclaimer-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    font-size: 1.2rem;
}

.agesync-top-disclaimer-copy {
    min-width: 0;
}

.agesync-top-disclaimer-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.25;
}

.agesync-top-disclaimer-text {
    font-size: 0.875rem;
    line-height: 1.5;
    opacity: 0.95;
    margin: 0;
}

@keyframes agesync-fadeup {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Heading ── */
#agesync-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 10px;
    line-height: 1.3;
}

/* ── Description (WYSIWYG content) ── */
#agesync-desc.agesync-desc {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.65;
    margin: 0 0 22px;
}

#agesync-desc.agesync-desc p {
    margin: 0 0 0.75em;
}

#agesync-desc.agesync-desc p:last-child {
    margin-bottom: 0;
}

#agesync-desc.agesync-desc a {
    color: var(--agesync-accent, #3FCB08);
    text-decoration: underline;
}

#agesync-desc.agesync-desc ul,
#agesync-desc.agesync-desc ol {
    margin: 0 0 0.75em 1.25em;
    padding: 0;
}

/* ── Checkbox rows ── */
.agesync-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.agesync-row:hover {
    border-color: var(--agesync-accent, #3FCB08);
    background-color: #f9fafb;
}

.agesync-row span {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.55;
}

/* Bold text inside checkbox labels gets accent color */
.agesync-row span strong {
    color: var(--agesync-accent, #3FCB08);
    font-weight: 700;
}

/* Links inside checkbox labels get accent color */
.agesync-row span a {
    color: var(--agesync-accent, #3FCB08);
    text-decoration: underline;
    transition: opacity 0.15s ease;
}

.agesync-row span a:hover {
    opacity: 0.8;
}

/* ── Custom checkbox input ── */
.agesync-cb {
    appearance: none;
    -webkit-appearance: none;
    width: 19px;
    height: 19px;
    min-width: 19px;
    margin-top: 1px;
    border: 2px solid #9ca3af;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.agesync-cb:checked {
    background-color: var(--agesync-accent, #3FCB08);
    border-color: var(--agesync-accent, #3FCB08);
}

.agesync-cb:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.agesync-cb:focus-visible {
    outline: 2px solid var(--agesync-accent, #3FCB08);
    outline-offset: 2px;
}

/* ── Accept All button ── */
button#agesync-accept-all.agesync-accept-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 46px;
    padding: 10px 14px;
    margin-top: 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    background-color: var(--agesync-accept, var(--agesync-btn, #3FCB08));
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.12s ease, border-color 0.18s ease;
}

button#agesync-accept-all.agesync-accept-all:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.12);
}

button#agesync-accept-all.agesync-accept-all:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}

.agesync-accept-all svg {
    flex-shrink: 0;
    color: #ffffff;
}

/* ── Action buttons row (two columns) ── */
.agesync-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    align-items: stretch;
}

.agesync-actions-single {
    display: block;
}

/* ── Decline & Exit ── */
#agesync-leave.agesync-decline {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: #6b7280;
    text-decoration: none;
    text-align: center;
    background: #fff;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

#agesync-leave.agesync-decline:hover {
    border-color: #d1d5db;
    background-color: #f9fafb;
    color: #374151;
}

/* ── Submit & Enter button ── */
#agesync-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 10px 14px;
    margin-top: 0;
    border: none;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: not-allowed;
    background-color: #d1d5db;
    color: #9ca3af;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.agesync-actions-single #agesync-btn {
    width: 100%;
}

#agesync-btn.agesync-active {
    background-color: var(--agesync-btn, #3FCB08);
    color: #ffffff;
    cursor: pointer;
}

#agesync-btn.agesync-active:hover {
    filter: brightness(0.92);
}

#agesync-btn.agesync-active:active {
    transform: scale(0.98);
}

#agesync-btn svg {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

#agesync-btn.agesync-active:hover svg {
    transform: scale(1.05);
}

/* ── Disclaimer ── */
#agesync-disclaimer {
    font-size: 0.72rem;
    color: #9ca3af;
    line-height: 1.6;
    margin-top: 18px;
    margin-bottom: 0;
}

.agesync-disc-link {
    color: var(--agesync-accent, #3FCB08);
    text-decoration: underline;
}

.agesync-disc-link:hover {
    opacity: 0.8;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    #agesync-card {
        padding: 28px 20px 24px;
    }
    #agesync-heading {
        font-size: 1.3rem;
    }
    .agesync-actions {
        flex-direction: column;
    }
    #agesync-leave.agesync-decline,
    #agesync-btn {
        width: 100%;
    }
}
