:root {
    --bg-color: #2d3644;
    --text-color: #1f1f1f;
    --primary-color: #ff5c00;
    --accent-green: #00d084;
    --accent-red: #ff3b30;
    --accent-amber: #ff9500;
    --card-bg: #ffffff;
    --border-color: #e8e8e8;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Header & Intro */
header {
    background: linear-gradient(135deg, #ff5c00 0%, #ff7a2e 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

h1 { 
    margin: 0; 
    font-size: 2.2rem; 
    letter-spacing: -0.5px;
    font-weight: 700;
}

.subtitle { 
    font-size: 1.1rem; 
    opacity: 0.95; 
    margin-bottom: 0.5rem;
}

.intro-box {
    background: white;
    /* Default for mobile: 95% width */
    max-width: 95%; 
    margin: -2rem auto 0.3rem;
    padding: 0.8rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    box-sizing: border-box;
}

/* Override for desktop only (screens wider than 900px) */
@media (min-width: 901px) {
    .intro-box {
        max-width: 900px;
    }
}

/* Ensure consistent font for all intro elements */
.intro-header,
.intro-content,
.intro-arrow {
    font-family: var(--font-main);
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-btn {
    background: white;
    border: 2px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: #666;
    font-weight: 600;
    margin-bottom: 10px;
}

.nav-btn:hover { 
    background: #f3f4f6; 
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.nav-btn.active { 
    background: var(--primary-color); 
    color: white; 
    border-color: var(--primary-color);
}

.nav-btn.completed {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

/* Main Content */
main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    text-align: center;
}

main h2 {
    text-align: left;
}

main h3 {
    text-align: left;
}

main p {
    text-align: left;
}

main ul {
    text-align: left;
}

main .benefit-combined {
    text-align: left;
}

.section-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: none;
    animation: fadeIn 0.4s ease;
}

.section-card.active { display: block; }

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

h2 { 
    color: #1e293b; 
    border-bottom: 3px solid var(--primary-color); 
    padding-bottom: 0.5rem; 
    margin-top: 0;
    font-weight: 700;
}

h3 { 
    color: #475569; 
    margin-top: 1.5rem;
    font-weight: 600;
}

/* Feature Boxes */
.achievement-box {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
}

.achievement-icon { 
    font-size: 1.5rem; 
    margin-right: 1rem; 
    line-height: 1; 
}

.benefit-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #075985;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
}

/* Technical Dropdown */
.tech-details {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.tech-toggle {
    background: #f8fafc;
    border: none;
    width: 100%;
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.tech-toggle::after {
    content: "▼";
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.tech-toggle:hover {
    background: #f1f5f9;
}

.tech-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    background: white;
}

.tech-content.open {
    padding: 1.5rem;
    max-height: 5000px;
    border-top: 1px solid var(--border-color);
}

/* Lists & Steps */
ul.checklist { 
    list-style: none; 
    padding: 0; 
}

ul.checklist li { 
    margin-bottom: 0.8rem; 
    padding-left: 1rem; 
    position: relative; 
}

ul.checklist li::before {
    content: "☐";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

ul.checklist li.done::before { 
    content: "☑"; 
    color: var(--accent-green); 
}

/* Interactive checkbox list */
ul.checklist-interactive { 
    list-style: none; 
    padding: 0;
    margin-left: 0;
}

ul.checklist-interactive li { 
    margin-bottom: 0.8rem; 
    padding-left: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    white-space: normal;
    word-wrap: break-word;
}

ul.checklist-interactive input[type="checkbox"] {
    margin-top: 0.3rem;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary-color) !important;
}

ul.checklist-interactive a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

ul.checklist-interactive a:hover {
    text-decoration: underline;
}

/* Provider Buttons */
h3.providers-heading {
    text-align: left;
    margin-bottom: 1rem;
}

ul.providers-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
    display: flex; 
    gap: 1rem; 
    flex-wrap: wrap;
    justify-content: flex-start;
}

ul.providers-list li {
    margin: 0;
    padding: 0;
    flex: 0 1 auto;
}

.provider-link {
    display: inline-block;
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.provider-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
    z-index: 9999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-label {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: center;
}

.progress-label-left {
    color: var(--accent-red);
}

.progress-label-right {
    color: var(--accent-green);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-green);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

body {
    padding-top: 60px;
}

/* Done Button */
.done-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.7rem 2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.done-btn:hover {
    background: #ff7a2e;
}

.done-btn.completed {
    background: var(--accent-green);
}

.done-btn.completed:hover {
    background: #00c878;
}

/* Intro Sections */
.intro-section {
    margin-bottom: 0rem;
}

.intro-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: #f8fafc;
    border-radius: 6px;
    user-select: none;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.intro-header:hover {
    background: #f1f5f9;
}

.intro-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: 0.5rem;
}

.intro-content {
    padding: 0.6rem 0.8rem;
    background: #fafbfc;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    margin-top: 0.2rem;
    line-height: 1.5;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 500px;
    opacity: 1;
    font-size: 0.9rem;
}

.intro-content.closed {
    max-height: 0;
    opacity: 0;
    padding: 0 0.8rem;
    overflow: hidden;
}

.intro-arrow.closed {
    transform: rotate(180deg);
}

/* Further Reading */
.further-reading {
    margin-top: 1.5rem;
    padding-top: 0;
    border-top: none;
}

.further-reading strong {
    display: block;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.further-reading a {
    display: inline;
    margin-right: 0;
    margin-bottom: 0;
    font-size: 0.95rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.further-reading a:hover {
    text-decoration: underline;
}

.further-reading .tech-details {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.further-reading .tech-toggle {
    background: #f8fafc;
    border: none;
    width: 100%;
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.further-reading .tech-toggle:hover { 
    background: #f1f5f9; 
}

.further-reading .tech-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    background: white;
    font-size: 0.95rem;
}

.further-reading .tech-content.open { 
    padding: 1.5rem; 
    max-height: 1000px; 
    border-top: 1px solid var(--border-color); 
}

/* Benefit Combined */
.benefit-combined {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-left: 5px solid var(--accent-green);
    color: #065f46;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.benefit-combined strong {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.benefit-combined ul {
    margin: 0;
    padding-left: 1.5rem;
}

.benefit-combined li {
    margin-bottom: 0.6rem;
}

/* Reduced indentation for all lists */
ul {
    margin-left: 0.5rem;
    padding-left: 0.5rem;
}

ul li {
    margin-left: 0;
    padding-left: 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 0.5rem 2rem 1rem 2rem;
    color: #64748b;
    font-size: 0.9rem;
    border: none !important; /* Forces removal of any border */
    margin: 0 !important;
    background: transparent; /* Optional: ensures no background line */
}
/* Hide the deeperdive nav button */
.nav-btn:has(+ .section-card#section-deeperdive) {
    display: none;
}

#section-deeperdive {
    display: block !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    animation: none !important;
    max-width: 100% !important;
}

#section-deeperdive .intro-box {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#section-deeperdive .intro-content {
    text-align: left;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    header {
        padding: 1.5rem 0.75rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .intro-box {
        margin: -1.5rem auto 1.5rem;
        padding: 1rem;
    }

    main {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }

    .section-card {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    h2 {
        font-size: 1.4rem;
        padding-bottom: 0.4rem;
    }

    h3 {
        font-size: 1.1rem;
        margin-top: 1.2rem;
        display: block;
        text-align: left;
    }

    p {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .benefit-combined {
        padding: 1rem;
        margin: 1rem 0;
    }

    .benefit-combined strong {
        font-size: 1rem;
        margin-bottom: 0.6rem;
    }

    .benefit-combined ul {
        padding-left: 1.2rem;
    }

    .benefit-combined li {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

    h3.providers-heading {
        text-align: left;
    }

    ul.providers-list {
        justify-content: flex-start;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    ul.providers-list li {
        flex: 0 1 auto;
    }

    .provider-link {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    ul.checklist-interactive {
        padding: 0;
    }

    ul.checklist-interactive li {
        margin-bottom: 0.7rem;
        gap: 0.6rem;
        font-size: 0.9rem;
        white-space: normal;
        word-wrap: break-word;
    }

    ul.checklist-interactive input[type="checkbox"] {
        margin-top: 0.2rem;
    }

    .nav-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        width: 100%;
        text-align: center;
    }

    .further-reading {
        margin-top: 1.5rem;
        padding-top: 0;
        text-align: left;
    }

    .further-reading h3 {
        text-align: left;
    }

    .further-reading a {
        display: block;
        margin-right: 0;
        margin-bottom: 0.8rem;
        font-size: 0.9rem;
    }

    .tech-toggle {
        padding: 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.4rem;
    }

    .intro-box {
        padding: 0.8rem;
    }

    .section-card {
        padding: 1rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .benefit-combined {
        padding: 0.8rem;
    }

    .provider-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }

    ul.checklist-interactive li {
        font-size: 0.85rem;
    }
}

input[type="checkbox"] {
    accent-color: var(--primary-color) !important;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.footer-social a {
    color: #64748b !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    background: transparent !important; /* Remove background circles if you want flat icons */
    border: none !important;
}

.footer-social a:hover {
    background: #475569;
    transform: translateY(-2px);
}

.footer-social a:visited {
    color: white;
}

.footer-social a:active {
    background: var(--primary-color);
    color: white;
}

.footer-social a:focus {
    outline: none;
    background: var(--primary-color);
}

.footer-social svg {
    fill: #64748b !important;
    width: 24px;
    height: 24px;
}

footer {
    padding: 0 !important;
    margin: 0 !important;
}

footer p {
    margin: 0 !important;
    padding: 0 !important;
}

.footer-social {
    margin-top: 0.3rem !important;
    gap: 0.5rem !important;
}

/* --- Popup Styles (Themed with Your Variables) --- */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 54, 68, 0.85); /* Uses --bg-color with opacity for a darker overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
    box-sizing: border-box;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: var(--bg-color); /* #2d3644 */
    color: #ffffff; /* White text for contrast on dark bg */
    padding: 1.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid var(--border-color); /* Subtle border using your variable */
}

@media (max-width: 480px) {
    .popup-content {
        padding: 1.2rem;
        font-size: 0.95rem;
    }
}

.popup-content h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color); /* #ff5c00 for the title */
}

.popup-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #e0e0e0; /* Light grey for body text */
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    z-index: 10;
    transition: color 0.2s;
}

.popup-close:hover {
    color: var(--primary-color); /* Turns orange on hover */
}

.popup-btn {
    background: var(--primary-color); /* #ff5c00 for the main button */
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 220px;
    align-self: center;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.popup-btn:hover {
    background: #ff7a2e; /* Slightly lighter orange for hover state */
    transform: translateY(-1px);
}

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