/* ═══════════════════════════════════════════════════════════════
 * SIFA Base — Design Tokens, Resets & Typography
 * ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
    /* Primary palette */
    --sifa-purple:       #603eb0;
    --sifa-purple-hover: #4e2fa0;
    --sifa-purple-bg:    #e0d8fa;
    --sifa-dark:         #022550;
    --sifa-red:          #ff5a63;

    /* Secondary palette */
    --sifa-teal:         #4ebab4;
    --sifa-teal-bg:      #d6fcfa;
    --sifa-secondary:    #bb43cb;
    --sifa-secondary-bg: #f6e6fa;

    /* App Core Surfaces (synced with app globals.css) */
    --sifa-core-background: #f5f2f1;
    --sifa-inner-panel-bg:  #fbf9f9;
    --sifa-item-panel-bg:   #f0ecec;
    --sifa-stroke:          #e5e2ea;
    --sifa-accent:          #5b42aa;

    /* Surfaces */
    --sifa-surface:      #f8f7fc;
    --sifa-surface-alt:  #f4f3f9;
    --sifa-white:        #ffffff;

    /* Borders */
    --sifa-border:       #e0ddf0;
    --sifa-border-light: #eeecf5;

    /* Text */
    --sifa-text:         #022550;
    --sifa-text-muted:   #6b7280;
    --sifa-text-light:   #9ca3af;

    /* Radius */
    --sifa-radius:       14px;
    --sifa-radius-sm:    10px;
    --sifa-radius-lg:    20px;
}

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--sifa-text);
    background: var(--sifa-core-background);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--sifa-purple);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--sifa-purple-hover);
}


/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--sifa-dark);
    line-height: 1.3;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }

/* Monospace — for financial figures, data */
.sifa-mono,
.sifa-data {
    font-family: 'JetBrains Mono', monospace;
}

/* ── Utility ── */
.sifa-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}


/* ═══════════════════════════════════════════════════════════════
 * Site Header (non-landing pages)
 * ═══════════════════════════════════════════════════════════════ */

.sifa-site-header {
    background: rgb(255 255 255 / 40%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sifa-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sifa-logo img {
    height: 25px;
    width: auto;
}

.sifa-header-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.sifa-header-nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--sifa-text-muted);
    transition: color 0.2s ease;
}

.sifa-header-nav a:hover {
    color: var(--sifa-purple);
}

/* Header CTA (Open Planner) */
.sifa-header-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    background: var(--sifa-purple);
    color: #fff !important;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.sifa-header-cta:hover {
    background: var(--sifa-purple-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(96, 62, 176, 0.25);
    color: #fff !important;
}

.sifa-header-cta svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
}


/* ═══════════════════════════════════════════════════════════════
 * SIFA Glass Panel — Ported from App globals.css
 * ═══════════════════════════════════════════════════════════════ */

.sifa-glass {
    background: linear-gradient(127deg, #ffffffc9 0%, #fff6 40%, #ffffff1a 100%);
    border-radius: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    border-left: 1px solid rgba(255, 255, 255, 0.7);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 20px 40px -8px rgba(0, 0, 0, 0.05),
        0 8px 16px -4px rgba(0, 0, 0, 0.03),
        inset 0px 1px 2px rgba(255, 255, 255, 1);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}


/* ═══════════════════════════════════════════════════════════════
 * Site Footer
 * ═══════════════════════════════════════════════════════════════ */

.sifa-site-footer {
    background: var(--sifa-core-background);
    border-top: 1px solid var(--sifa-border);
    padding: 24px 0;
    margin-top: 20px;
}

.sifa-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.sifa-footer-inner p {
    font-size: 13px;
    color: var(--sifa-text-muted);
}

.sifa-footer-nav {
    display: flex;
    gap: 16px;
}

.sifa-footer-nav a {
    font-size: 13px;
    color: var(--sifa-text-muted);
    transition: color 0.2s ease;
}

.sifa-footer-nav a:hover {
    color: var(--sifa-purple);
}


/* ═══════════════════════════════════════════════════════════════
 * Prose Typography — Standard Content Pages
 * (Privacy, Terms, etc.)
 * ═══════════════════════════════════════════════════════════════ */

.sifa-content h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--sifa-dark);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

/* Hide duplicate h1 when the template already outputs the page title */
.sifa-content .entry-content > h1:first-child {
    display: none;
}

.sifa-content h2 {
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: var(--sifa-dark);
    letter-spacing: -0.01em;
    margin-top: 40px;
    margin-bottom: 12px;
}

.sifa-content h3 {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 600;
    color: var(--sifa-dark);
    margin-top: 28px;
    margin-bottom: 8px;
}

.sifa-content p {
    font-size: 15px;
    line-height: 1.75;
    color: var(--sifa-text-muted);
    margin-bottom: 16px;
    max-width: 720px;
}

.sifa-content ul,
.sifa-content ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.sifa-content li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--sifa-text-muted);
    margin-bottom: 8px;
    padding-left: 4px;
}

.sifa-content li::marker {
    color: var(--sifa-purple);
}

.sifa-content a {
    color: var(--sifa-purple);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.sifa-content a:hover {
    color: var(--sifa-purple-hover);
}

/* ── Tables ── */
.sifa-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 24px 0 28px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--sifa-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    font-size: 14px;
}

.sifa-content table thead th {
    background: var(--sifa-purple-bg);
    color: var(--sifa-purple);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid var(--sifa-border);
}

.sifa-content table tbody td {
    padding: 14px 18px;
    color: var(--sifa-text);
    border-bottom: 1px solid var(--sifa-border-light);
    line-height: 1.5;
}

.sifa-content table tbody tr:last-child td {
    border-bottom: none;
}

.sifa-content table tbody tr:hover {
    background: rgba(96, 62, 176, 0.02);
}

/* ── Strong / bold ── */
.sifa-content strong {
    color: var(--sifa-dark);
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════════
 * Responsive
 * ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .sifa-header-inner {
        padding: 10px 16px;
    }

    /* Compact nav sizing */
    .sifa-header-nav {
        gap: 12px;
    }

    .sifa-header-nav a {
        font-size: 12px;
    }

    .sifa-header-cta {
        font-size: 12px;
        padding: 8px 14px;
        margin-left: 0;
    }

    /* Hide 'Log out' on mobile — accessible from My Account page */
    .sifa-header-nav a:nth-child(2):not(.sifa-header-cta) {
        display: none;
    }

    .sifa-logo img {
        height: 22px;
    }

    .sifa-footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .sifa-content {
        padding: 24px 16px;
    }
}


/* ═══════════════════════════════════════════════════════════════
 * SIFA Loading Spinner — Global override for WooCommerce BlockUI
 * Replaces the default GIF spinner with a modern CSS spinner
 * ═══════════════════════════════════════════════════════════════ */

.blockUI.blockOverlay {
    background: rgba(255, 255, 255, 0.75) !important;
    background-image: none !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    opacity: 1 !important;
    cursor: default !important;
}

.blockUI.blockOverlay::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 32px !important;
    height: 32px !important;
    margin: -16px 0 0 -16px !important;
    border: 3px solid rgba(96, 62, 176, 0.15) !important;
    border-top-color: var(--sifa-purple, #603eb0) !important;
    border-radius: 50% !important;
    animation: sifa-spin 0.7s linear infinite !important;
    background: none !important;
}

.blockUI.blockMsg,
.blockUI.blockMsg.blockElement,
.woocommerce .blockUI.blockMsg {
    display: none !important;
    background: none !important;
    background-image: none !important;
    border: none !important;
}

@keyframes sifa-spin {
    to { transform: rotate(360deg); }
}
