:root {
    /* ===== Primary backgrounds & text ===== */
    /* Deep dark shade derived from Imago main background */
    --back-color: #fafafa;
    --background-main: #ffffff;           /* EXACT IMAGO MAIN DARK BG */
    --text-color: #000000;                /* EXACT IMAGO WHITE TEXT */
    --text-muted: #0f0f0f; /* muted white for secondary text */
    --border-color: rgba(44, 213, 197, 0.15); /* subtle mint border */

    /* ===== Accent colours ===== */
    /* Imago signature mint/teal and ice shades */
    --accent-1: #2cd5c5;                  /* EXACT IMAGO TEAL/MINT (Primary accent) */
    --accent-glow: rgba(44, 213, 197, 0.25);
    --accent-1-light: #aff0ef;            /* EXACT IMAGO LIGHT MINT variant */
    --accent-2: #24b0a3;                  /* deeper teal for secondary states/gradients */

    /* Subtle hover using a soft mix of the branding palette */
    --hover-color: rgba(175, 240, 239, 0.08);

    /* ===== Border radii ===== */
    --card-radius: 28px;
    --option-radius: 20px;
    --end-wrapper-radius: 16px;
    --end-inner-radius: 12px;
    --share-btn-radius: 30px;

    /* ===== End‑component specific colours ===== */
    /* Rebalanced to sit beautifully on the deep forest background */
    --end-red: #2cd5c4;
    --end-blue: #43a39a;
    --end-teal: #2cd5c5;                  /* linked directly to branding */
    --end-bg: #1d1d1d;                    /* dark step of the theme base */
    --end-text: #ffffff;

    /* ===== Font families ===== */
    --font-family-base: 'Oswald', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'Courier New', monospace;
    --font-family-heading: 'Impact', 'Arial Black', sans-serif;
    --font-family-sans: 'Arial', sans-serif;
    --font-family-serif: 'Georgia', 'Times New Roman', serif;

    /* ===== Transitions ===== */
    --transition-speed: 0.2s;
    --transition-timing: ease;

    /* ===== Misc colours ===== */
    /* Replaced old purple/silver gradient with an elegant Imago mint-to-white lift */
    --mcq-gradient-start: #ffffff;       /* EXACT IMAGO WHITE */
    --mcq-gradient-end: #aff0ef;         /* EXACT IMAGO LIGHT MINT */
    --mcq-option-border: rgba(44, 213, 197, 0.12);
    --mcq-option-shadow: rgba(0, 0, 0, 0.3);

    --imago-3: #283332;
}

/* ---------- Global reset / base ---------- */
html {
    background-color: var(--background-main);
    color: var(--text-color);
    font-family: var(--font-family-mono);
    /*overflow: hidden;*/
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--back-color);
    /*overflow: hidden;*/
    text-align: center;
}

a {
    text-decoration: none;
    color: var(--text-color);
}

h1 {
    font-size: 3rem;
}

/* ---------- Second‑file specific containers ---------- */
.welcome-container {
    padding-top: 5%;
}

.foot-container {
    text-align: center;
    padding-top: 70%;
    position: fixed;
    bottom: 2%;
    opacity: 0.75;
    font-size: 0.68rem;
    padding-left: 5px;
    padding-right: 5px;
}

.foot-container a {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--accent-2);
    opacity: 1;
}

#main-base-box {
    width: 100vw;
    height: 100vh;
}

body {
  font-family: "Oswald", sans-serif;
  font-optical-sizing: auto;
  font-weight: normal;
  font-style: normal;
}

/* ---------- First‑file component containers ---------- */
.component-container {
    position: absolute;
    display: none;
    box-sizing: border-box;
    font-family: 'Oswald';
}

.component-container > div {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.standard-component {
    background-color: var(--back-color);
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    display: flex;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
    flex-direction: column;
    color: var(--text-color);
    font-family: var(--font-family-base);
    backdrop-filter: blur(2px);
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.5);
    transition: transform var(--transition-speed) var(--transition-timing),
                box-shadow var(--transition-speed) var(--transition-timing);
    box-sizing: border-box;
}

/* ---------- Text component ---------- */
.text-component {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 12px;
}

.text-component p {
    font-size: clamp(0.9rem, 6.5vw, 1.8rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    text-align: left;
    color: var(--accent-1);
    margin: 0;
    padding: 0;
}

/* ---------- Header component ---------- */
.header-component {
    border-radius: 0 0 var(--card-radius) var(--card-radius);
    background-color: var(--back-color);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.header-component img {
    max-height: 40px;
    width: auto;
}

.nav-menu {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    flex-grow: 1;
}

.progress-bar {
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-1-light));
}


/* ---------- MCQ component ---------- */
/* ---------- MCQ component ---------- */
.mcq-component {
    box-sizing: border-box;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.05), transparent);
}

.mcq-header {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.mcq-question {
    margin: 0;
    font-size: clamp(0.9rem, 6.5vw, 1.8rem);
    font-weight: 800;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--mcq-gradient-start), var(--mcq-gradient-end));
    background-clip: text;
    -webkit-background-clip: text;
    color: var(--accent-1);
    letter-spacing: -0.01em;
}

.mcq-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex-grow: 1;
    width: 100%;
    padding-right: 4px;
}

.mcq-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    padding-left: 0;
    border: 1px solid var(--mcq-option-border);
    border-radius: var(--option-radius);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    user-select: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 5px var(--mcq-option-shadow);
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

.option-text {
    font-family: 'Gentium Plus';
    font-size: clamp(0.8rem, 4.5vw, 1.6rem);
    font-weight: 660;
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s, text-shadow 0.2s;
    line-height: 1.2;
    text-align: center;
}

.mcq-option input[type=radio] {
    opacity: 0;
}

/* Container for the text and sub-options to allow vertical stacking inside the option */
.mcq-main-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0 16px;
}

/* Grid layout for sub-answers */
/* Update to sub-options for better interaction */
.mcq-suboptions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
    width: 100%;
}

.sub-column {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    color: #fff;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sub-column:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.sub-column.selected {
    background: var(--accent-1);
    border-color: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}



/* ---------- End component (animated border) ---------- */
.end-component-wrapper {
    position: relative;
    max-width: 420px;
    margin: 0 auto;
    padding: 4px;
    border-radius: var(--end-wrapper-radius);
    overflow: hidden;
    background-color: var(--end-bg);
}

.end-component-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--end-red) 90deg,
        transparent 180deg,
        var(--end-blue) 270deg,
        transparent 360deg
    );
    animation: spin-border 12s linear infinite;
    z-index: 1;
}

@keyframes spin-border {
    100% { transform: rotate(360deg); }
}

.end-component-inner {
    position: relative;
    z-index: 2;
    background-size: cover;
    background-position: center;
    border-radius: var(--end-inner-radius);
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--text-color);
}

.title {
    color: var(--end-teal);
    font-family: 'Oswald';
    font-size: 32px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 15px 0;
    line-break: strict;
}

.subtitle {
    color: var(--end-teal);
    font-family: 'Oswald';
    font-size: 20px;
    line-height: 1.4;
    margin: 0 0 25px 0;
}

.main-text {
    font-family: 'Gentium Plus';
    font-size: clamp(0.8rem, 4.5vw, 1.6rem);
    line-height: 1.6;
    margin: 0 0 35px 0;
    color: var(--end-text);
}

.section-title {
    color: var(--end-teal);
    font-family: 'Oswald';
    font-size: 22px;
    margin: 0 0 10px 0;
}

.section-text {
    font-family: 'Gentium Plus';
    font-size: clamp(0.8rem, 4.5vw, 1.6rem);
    font-weight: bold;
    line-height: 1.5;
    margin: 0 0 35px 0;
    color: var(--end-text);
}

.share-btn {
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), rgba(0,0,0,0.6));
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(42, 196, 181, 0.2);
    border-radius: var(--share-btn-radius);
    color: var(--end-teal);
    font-family: var(--font-family-sans);
    font-size: 22px;
    padding: 12px 50px;
    cursor: pointer;
    /*text-transform: uppercase;*/
    transition: all 0.3s ease;
}

.share-btn:hover {
    box-shadow: 0 0 25px rgba(42, 196, 181, 0.5);
    border-color: rgba(42, 196, 181, 0.5);
    background: rgba(0, 0, 0, 0.8);
}

.privacy-component {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0.25;
    color: var(--imago-3) !important;
}

.privacy-component svg {
    flex-shrink: 0;

}

.privacy-component p {
    font-size: 0.45rem;
    margin: 0;

}

.privacy-component path {
    fill: var(--imago-3);
}

/* Button group – flex container */
.button-group {
    display: flex;
    gap: 12px;                /* spacing between the two buttons */
    justify-content: center;
    width: 100%;
    margin-top: 10px;         /* adjust as needed */
}

/* Base styling for both buttons (reuses .share-btn styles) */
.program-btn,
.next-btn,
.share-btn,
.retry-btn {
    flex: 1;                  /* both buttons take equal width */
    min-width: 120px;         /* prevent them from becoming too narrow */
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), rgba(0,0,0,0.6));
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(42, 196, 181, 0.2);
    border-radius: 30px;
    color: #2AC4B5;
    font-family: 'Arial', sans-serif;
    font-size: 22px;
    padding: 12px 20px;
    cursor: pointer;
    /*text-transform: uppercase;*/
    transition: all 0.3s ease;
    text-align: center;
}

.program-btn:hover
.next-btn:hover,
.share-btn:hover,
.retry-btn:hover {
    box-shadow: 0 0 25px rgba(42, 196, 181, 0.5);
    border-color: rgba(42, 196, 181, 0.5);
    background: rgba(0, 0, 0, 0.8);
}

/* Optional: ensure Retry button uses the same accent colour */
.retry-btn {
    color: #2AC4B5;           /* same teal as Share */
}


/* ============================================================
   PRIVACY PAGE STYLES (refactored to use main variables)
   ============================================================ */

/* privacy page container – inherits dark background from :root */
.privacy-page {
    overflow: auto;
    min-height: 100vh;
    padding: 2rem 1.25rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    background-color: var(--background-main);
    color: var(--text-color);
    font-family: var(--font-family-serif);
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.privacy-page .page-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Language selector */
.privacy-page .lang-selector {
    align-self: flex-end;
    margin-bottom: -1rem;
    padding-top: 10px;
}

.privacy-page .lang-selector select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>') no-repeat right 0.5rem center;
    background-size: 0.8rem;
    border: 1px solid var(--accent-1);
    border-radius: 2rem;
    color: var(--text-color);
    font-family: var(--font-family-serif);
    font-size: 0.8rem;
    padding: 0.35rem 1.8rem 0.35rem 0.9rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-speed) var(--transition-timing);
}

.privacy-page .lang-selector select:hover,
.privacy-page .lang-selector select:focus {
    border-color: var(--accent-1-light);
}

/* Section headings */
.privacy-page h2 {
    font-weight: 400;
    font-size: 1.8rem;
    letter-spacing: -0.01em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.2rem;
    margin-bottom: 0.2rem;
    color: var(--text-color);
    margin-top: 0;
}

/* Legal cards */
.privacy-page .legal-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.privacy-page .legal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--card-radius);
    padding: 1rem 0.4rem;
    text-decoration: none;
    color: var(--text-color);
    transition: border-color var(--transition-speed) var(--transition-timing),
                background var(--transition-speed) var(--transition-timing);
    cursor: pointer;
}

.privacy-page .legal-card:hover {
    border-color: var(--accent-1);
    background: rgba(44, 213, 197, 0.08);
}

.privacy-page .legal-card svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent-1);
    margin-bottom: 0.5rem;
    transition: transform var(--transition-speed) var(--transition-timing);
}

.privacy-page .legal-card:hover svg {
    transform: scale(1.05);
}

.privacy-page .legal-card span {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

/* Summary grid */
.privacy-page .summary-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.privacy-page .summary-item {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.8rem 1rem;
    border-radius: 0.6rem;
    border: 1px solid transparent;
    transition: border-color var(--transition-speed) var(--transition-timing);
}

.privacy-page .summary-item:hover {
    border-color: rgba(44, 213, 197, 0.3);
}

.privacy-page .summary-item svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent-1);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.privacy-page .summary-item p {
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--text-muted);
    margin: 0;
}

/* Bottom actions */
.privacy-page .actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-color);
}

.privacy-page .delete-link {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color var(--transition-speed) var(--transition-timing),
                opacity var(--transition-speed) var(--transition-timing);
    opacity: 0.7;
}

.privacy-page .delete-link:hover {
    color: #e06b6b;
    opacity: 1;
}

.privacy-page .delete-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.privacy-page .retake-btn {
    background: transparent;
    border: 1px solid var(--accent-1);
    color: var(--text-color);
    padding: 0.7rem 1.6rem;
    border-radius: 2.5rem;
    font-family: var(--font-family-serif);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: background var(--transition-speed) var(--transition-timing),
                border-color var(--transition-speed) var(--transition-timing);
    cursor: pointer;
}

.privacy-page .retake-btn:hover {
    background: rgba(44, 213, 197, 0.15);
    border-color: var(--accent-1-light);
}

.privacy-page .retake-btn .emoji-arrow {
    font-size: 1.1rem;
}

/* responsive adjustments for privacy page */
@media (max-width: 400px) {
    .privacy-page .actions-row {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .privacy-page .delete-link {
        justify-content: center;
    }
    .privacy-page .retake-btn {
        justify-content: center;
    }
}