/* Referrals Terms Page Styles */

/* Base Variables */
:root {
    --primary-blue: #0e7be0;
    --dark-blue: #1a2233;
    --light-blue: #0065FE;
    --light-gray: #cfd8e3;
    --white: #ffffff;
    --shadow: 0 2px 24px 0 rgba(30, 40, 60, 0.10);
    --border-radius: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero Section */
#referral-hero {
    background:
        linear-gradient(90deg, rgba(26, 34, 51, 0.8) 0%, rgba(26, 34, 51, 0.8) 100%),
        url(/wp-content/themes/heimdal/img/redesign-v3/bett-comp/hero-banner.jpg) no-repeat center center;
    background-size: cover;
    color: var(--white);
    padding: clamp(4rem, 12vw, 14rem) 1rem clamp(3rem, 8vw, 10rem);
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#referral-hero h1 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    margin-bottom: clamp(0.75rem, 1.5vw, 1.2rem);
    letter-spacing: 0.3px;
    max-width: min(940px, calc(100vw - 2rem));
    margin-left: auto;
    margin-right: auto;
    line-height: 1.2;
    font-size: clamp(1.5rem, 5vw, 3.5rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

#referral-hero p {
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(0.95rem, 3vw, 1.5rem);
    font-weight: 600;
    margin-bottom: 0;
    color: var(--light-gray);
    letter-spacing: -0.1px;
    max-width: min(800px, calc(100vw - 2rem));
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Body Background */
body {
    background-image: url("/wp-content/themes/heimdal/img/redesign-v3/homepage/partner-bg.jpg");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

/* Terms Section Container */
.referral-terms-section {
    border: 2px solid var(--light-blue);
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: clamp(1rem, 3vw, 3rem) 1rem;
    max-width: min(900px, calc(100vw - 2rem));
    padding: clamp(1rem, 3vw, 3.5rem) clamp(0.75rem, 2vw, 2.5rem);
    position: relative;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    overflow: hidden;
    box-sizing: border-box;
    width: calc(100% - 2rem);
    margin-left: auto;
    margin-right: auto;
}

.referral-terms-section:hover {
    box-shadow: 0 8px 32px 0 rgba(30, 40, 60, 0.15);
    transform: translateY(-2px);
}

.referral-terms-section h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    margin-bottom: clamp(1rem, 2.5vw, 2.5rem);
    text-align: center;
    letter-spacing: 0.3px;
    font-size: clamp(1.1rem, 3.5vw, 2rem);
    color: var(--dark-blue);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0 0.5rem;
}

/* Terms List Styling */
.referral-terms-list {
    counter-reset: referral-terms;
    padding-left: 0;
    margin-bottom: clamp(1rem, 2.5vw, 2.5rem);
    width: 100%;
    overflow: visible;
}

.referral-terms-list>li {
    list-style: none;
    position: relative;
    padding-left: clamp(1.5rem, 3.5vw, 3.5rem);
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(0.9rem, 3.5vw, 1.25rem);
    line-height: 1.5;
    padding-top: clamp(0.5rem, 1.2vw, 1.1rem);
    padding-bottom: clamp(0.5rem, 1.2vw, 1.1rem);
    margin-bottom: 0.5rem;
    transition: var(--transition);
    border-radius: 6px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.referral-terms-list>li:hover {
    background-color: rgba(14, 123, 224, 0.05);
}

.referral-terms-list>li:before {
    counter-increment: referral-terms;
    content: counter(referral-terms) ".";
    position: absolute;
    left: 0;
    top: clamp(0.5rem, 1.2vw, 1.1rem);
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--primary-blue);
    font-size: clamp(0.9rem, 3.5vw, 1.25rem);
    min-width: 1.5rem;
    text-align: right;
    padding-right: 0.5rem;
    box-sizing: border-box;
}

/* Strong elements within list items */
.referral-terms-list>li>strong {
    color: var(--dark-blue);
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
    font-size: clamp(0.95rem, 3.8vw, 1.3rem);
    font-family: 'Inter', sans-serif;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Nested Lists Styling - Mobile Optimized */
.referral-terms-list ul {
    list-style-type: none;
    padding-left: clamp(0.5rem, 1.5vw, 1.5rem);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
    overflow: visible;
}

.referral-terms-list ul li {
    position: relative;
    padding-left: clamp(1rem, 2.5vw, 2rem);
    font-size: clamp(0.85rem, 3.2vw, 1.15rem);
    line-height: 1.4;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    margin-bottom: 0.25rem;
    color: #2d3748;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.referral-terms-list ul li:before {
    content: "•";
    position: absolute;
    left: 0.25rem;
    top: 0.25rem;
    color: var(--primary-blue);
    font-size: 1.1em;
    font-weight: bold;
    min-width: 0.5rem;
}

/* Deeply Nested Lists (ul within ul) - Mobile Optimized */
.referral-terms-list ul ul {
    padding-left: clamp(0.5rem, 1.5vw, 1.5rem);
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.referral-terms-list ul ul li {
    font-size: clamp(0.8rem, 3vw, 1.05rem);
    padding-left: clamp(1rem, 2.5vw, 2rem);
    color: #4a5568;
    line-height: 1.35;
}

.referral-terms-list ul ul li:before {
    content: "◦";
    color: rgba(14, 123, 224, 0.8);
    font-size: 1em;
    left: 0.35rem;
}

/* Special styling for lists with long content */
.referral-terms-list li,
.referral-terms-list ul li,
.referral-terms-list ul ul li {
    max-width: 100%;
    box-sizing: border-box;
}

/* Link Styling */
.referral-terms-section a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.referral-terms-section a:hover,
.referral-terms-section a:focus {
    color: var(--dark-blue);
    border-bottom-color: var(--primary-blue);
    outline: none;
}

/* Contact paragraph styling */
.referral-terms-section>.container>p:last-child {
    text-align: center;
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    color: var(--dark-blue);
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 101, 254, 0.2);
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0 0.5rem;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .referral-terms-section {
        margin: 1rem;
        padding: 1rem 0.75rem;
        width: calc(100% - 2rem);
    }

    .referral-terms-list>li {
        padding-left: 2rem;
        margin-bottom: 0.75rem;
    }

    .referral-terms-list>li:before {
        left: 0;
        min-width: 1.5rem;
        text-align: right;
        padding-right: 0.25rem;
    }

    .referral-terms-list ul {
        padding-left: 0.5rem;
    }

    .referral-terms-list ul li {
        padding-left: 1.5rem;
    }

    .referral-terms-list ul ul li {
        padding-left: 1.5rem;
    }

    /* Reduce spacing on very small screens */
    .referral-terms-list ul li:before {
        left: 0.25rem;
    }

    .referral-terms-list ul ul li:before {
        left: 0.35rem;
    }
}

@media (max-width: 480px) {
    #referral-hero {
        padding: 7rem 1rem 4rem;
        min-height: 45vh;
    }

    #referral-hero h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    #referral-hero p {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .referral-terms-section {
        margin: 0.75rem;
        padding: 0.75rem 0.5rem;
        width: calc(100% - 1.5rem);
    }

    .referral-terms-section h2 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .referral-terms-list>li {
        padding-left: 1.75rem;
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .referral-terms-list>li:before {
        font-size: 0.85rem;
        min-width: 1.25rem;
    }

    .referral-terms-list>li>strong {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .referral-terms-list ul li {
        padding-left: 1.25rem;
        font-size: 0.8rem;
    }

    .referral-terms-list ul ul li {
        padding-left: 1.25rem;
        font-size: 0.75rem;
    }

    .referral-terms-list ul li:before {
        left: 0.15rem;
        font-size: 1em;
    }

    .referral-terms-list ul ul li:before {
        left: 0.25rem;
        font-size: 0.9em;
    }
}

/* Extra small devices (phones, less than 360px) */
@media (max-width: 360px) {
    .referral-terms-section {
        margin: 0.5rem;
        padding: 0.5rem 0.25rem;
        width: calc(100% - 1rem);
    }

    .referral-terms-list>li {
        padding-left: 1.5rem;
    }

    .referral-terms-list>li:before {
        min-width: 1rem;
        padding-right: 0.15rem;
    }

    .referral-terms-list ul li {
        padding-left: 1rem;
    }

    .referral-terms-list ul ul li {
        padding-left: 1rem;
    }
}

/* Print Styles */
@media print {
    .referral-terms-section {
        border: 1px solid #000;
        box-shadow: none;
        margin: 0;
        max-width: 100%;
        break-inside: avoid;
        padding: 1rem;
    }

    .referral-terms-section a {
        color: #000;
        text-decoration: underline;
    }

    .referral-terms-list>li {
        page-break-inside: avoid;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .referral-terms-section {
        border-width: 3px;
    }

    .referral-terms-list>li:before {
        -webkit-text-fill-color: currentColor;
        background: none;
    }

    .referral-terms-list ul li:before {
        color: #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .referral-terms-section:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .referral-terms-section {
        background: #1a2233;
        border-color: #2d8fff;
        color: #e2e8f0;
    }

    .referral-terms-section h2 {
        color: #f7fafc;
    }

    .referral-terms-list>li>strong {
        color: #f7fafc;
    }

    .referral-terms-list ul li {
        color: #cbd5e0;
    }

    .referral-terms-list ul ul li {
        color: #a0aec0;
    }

    .referral-terms-section a {
        color: #63b3ed;
    }

    .referral-terms-section a:hover {
        color: #90cdf4;
    }
}