/* ELIDZ Skills Portal — Terms & Privacy (matches public landing) */

:root {
    --navy-950: #06142b;
    --navy-900: #0b1f3f;
    --navy-800: #12305a;
    --orange-500: #e9812b;
    --orange-600: #d26d18;
    --orange-300: #f7b46c;
    --sand-50: #fbf9f4;
    --sand-100: #f4f1e8;
    --ink: #13233a;
    --muted: #5a6878;
    --line: rgba(19, 35, 58, 0.1);
    --white: #ffffff;
    --nav-height: 76px;
    --font: "Outfit", system-ui, sans-serif;
    --display: "Source Serif 4", Georgia, serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --wrap: min(1160px, calc(100% - 2.5rem));
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 1.5rem); }

body {
    font-family: var(--font);
    color: var(--ink);
    line-height: 1.7;
    background: var(--sand-50);
    -webkit-font-smoothing: antialiased;
}

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

:where(a, button):focus-visible {
    outline: 3px solid rgba(233, 129, 43, 0.6);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 10001;
    padding: 0.65rem 1rem;
    background: var(--navy-900);
    color: var(--white);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Nav — floating island */
.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
    z-index: 1000;
    pointer-events: none;
}
.nav-container {
    position: relative;
    width: var(--wrap);
    height: calc(var(--nav-height) - 14px);
    margin-inline: auto;
    padding: 0 0.6rem 0 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(6, 20, 43, 0.14);
    pointer-events: auto;
    overflow: hidden;
}
.nav-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--orange-500), var(--orange-300));
    transform: scaleX(var(--progress, 0));
    transform-origin: left center;
}

.nav-brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; flex-shrink: 0; }
.brand-logo { height: 36px; width: auto; max-width: min(200px, 42vw); object-fit: contain; }
.brand-portal-tag {
    padding: 0.25rem 0.6rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--white);
    background: var(--navy-900);
    border-radius: 999px;
    white-space: nowrap;
}

.doc-switch {
    display: flex;
    gap: 0.15rem;
    margin-inline: auto;
    padding: 0.3rem;
    background: rgba(11, 31, 63, 0.05);
    border-radius: 999px;
}
.doc-switch a {
    padding: 0.45rem 0.95rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    border-radius: 999px;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.25s ease;
}
.doc-switch a:hover { color: var(--navy-900); }
.doc-switch a[aria-current="page"] {
    color: var(--navy-900);
    font-weight: 600;
    background: var(--white);
    box-shadow: 0 2px 8px rgba(11, 31, 63, 0.1);
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.62rem 1.1rem;
    border-radius: 999px;
    background: var(--orange-500);
    color: var(--white);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}
.nav-back i { font-size: 0.78rem; transition: transform 0.25s var(--ease); }
.nav-back:hover { background: var(--orange-600); }
.nav-back:hover i { transform: translateX(-3px); }

/* Hero */
.hero {
    position: relative;
    isolation: isolate;
    padding: calc(var(--nav-height) + 4rem) 0 4.5rem;
    color: var(--white);
    background: var(--navy-950);
    overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; }
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(6, 20, 43, 0.97) 0%, rgba(6, 20, 43, 0.88) 50%, rgba(6, 20, 43, 0.6) 100%),
        radial-gradient(circle at 0% 100%, rgba(233, 129, 43, 0.25), transparent 50%);
}
.hero-inner { width: var(--wrap); margin-inline: auto; }

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--orange-300);
}
.hero-tag::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }

.hero h1 {
    font-family: var(--display);
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.035em;
    margin-bottom: 1rem;
}
.hero p { max-width: 52ch; font-size: 1.1rem; color: rgba(255, 255, 255, 0.8); }

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.75rem;
}
.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.88);
}
.hero-meta i { color: var(--orange-300); font-size: 0.78rem; }

/* Layout */
.doc-layout {
    width: var(--wrap);
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3.5rem, 8vw, 6rem);
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}

/* Table of contents */
.toc {
    position: sticky;
    top: calc(var(--nav-height) + 1.5rem);
}
.toc-title {
    margin-bottom: 0.9rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.toc ol { list-style: none; display: grid; gap: 0.1rem; border-left: 2px solid var(--line); }
.toc nav a {
    display: flex;
    gap: 0.65rem;
    margin-left: -2px;
    padding: 0.45rem 0.9rem;
    border-left: 2px solid transparent;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.toc nav a span { font-variant-numeric: tabular-nums; color: #9aa5b1; font-weight: 600; }
.toc nav a:hover { color: var(--navy-900); }
.toc nav a.active { color: var(--navy-900); font-weight: 600; border-left-color: var(--orange-500); }
.toc nav a.active span { color: var(--orange-600); }

.toc-help {
    margin-top: 1.75rem;
    padding: 1.1rem;
    border-radius: 16px;
    background: var(--white);
    border: 1px solid var(--line);
    font-size: 0.88rem;
    color: var(--muted);
}
.toc-help strong { display: block; margin-bottom: 0.25rem; color: var(--navy-900); }
.toc-help a { color: var(--orange-600); font-weight: 600; text-decoration: none; }
.toc-help a:hover { text-decoration: underline; }

/* Document */
.doc {
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: 24px;
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: 0 22px 50px rgba(11, 31, 63, 0.06);
}

.doc-section + .doc-section {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--line);
}

.doc-section h2 {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    margin-bottom: 1rem;
    font-family: var(--display);
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--navy-900);
}
.doc-section h2 .num {
    flex-shrink: 0;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--orange-600);
    font-variant-numeric: tabular-nums;
}

.doc-section h3 {
    margin: 1.5rem 0 0.4rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--navy-900);
}
.doc-section p { margin-bottom: 0.9rem; color: var(--muted); font-size: 1rem; }
.doc-section p:last-child { margin-bottom: 0; }
.doc-section a { color: var(--orange-600); font-weight: 600; text-decoration: none; }
.doc-section a:hover { text-decoration: underline; }
.doc-section strong { color: var(--navy-900); }

.doc-section ul {
    list-style: none;
    display: grid;
    gap: 0.55rem;
    margin: 0.4rem 0 0.9rem;
    color: var(--muted);
}
.doc-section ul li { position: relative; padding-left: 1.4rem; }
.doc-section ul li::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 0.68em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--orange-500);
}

/* Callouts */
.box {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin: 1.25rem 0 0;
    padding: 1rem 1.15rem;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.6;
}
.box > i {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 0.8rem;
}
.box > div { padding-top: 0.15rem; }
.box-info { background: var(--sand-50); border: 1px solid var(--line); color: var(--ink); }
.box-info > i { background: var(--navy-900); color: var(--white); }
.box-warning { background: #fff8f1; border: 1px solid rgba(233, 129, 43, 0.25); color: #6f4a16; }
.box-warning > i { background: var(--orange-500); color: var(--white); }
.box-warning strong { color: #6f4a16; }
.box-success { background: #f0f8f3; border: 1px solid #cfe6d8; color: #245c40; }
.box-success > i { background: #2f8a5b; color: var(--white); }

/* POPIA rights */
.rights-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 1.1rem 0 1.25rem;
}
.right-card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.9rem;
    align-items: start;
    padding: 1.1rem;
    border-radius: 16px;
    background: var(--sand-50);
    border: 1px solid var(--line);
}
.right-card i {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--white);
    border: 1px solid var(--line);
    color: var(--orange-600);
}
.right-card h4 { font-size: 1rem; font-weight: 700; color: var(--navy-900); }
.doc-section .right-card p { margin: 0; font-size: 0.9rem; }

/* Contact list */
.contact-list { gap: 0.7rem !important; }
.doc-section .contact-list li { padding-left: 0; }
.doc-section .contact-list li::before { display: none; }
.contact-list li {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 1rem;
    padding: 0.8rem 1rem !important;
    border-radius: 12px;
    background: var(--sand-50);
}
.contact-list li strong { font-weight: 600; }

/* Footer */
.footer {
    background: var(--navy-950);
    color: rgba(255, 255, 255, 0.65);
    padding: 2.25rem 0;
    font-size: 0.88rem;
}
.footer-inner {
    width: var(--wrap);
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.footer a { color: var(--orange-300); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { color: rgba(255, 255, 255, 0.7); }

/* Back to top */
.back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 50;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--navy-900);
    color: var(--white);
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(6, 20, 43, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
}
.back-to-top:hover { background: var(--orange-500); }
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: none; }

/* Responsive */
@media (max-width: 960px) {
    .doc-layout { grid-template-columns: 1fr; }
    .toc { position: static; }
    .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; gap: 0.25rem 1rem; }
    .toc nav a { margin-left: 0; padding: 0.35rem 0; border-left: 0; }
    .toc nav a.active { border-left: 0; }
    .toc-help { display: none; }
}

@media (max-width: 720px) {
    :root { --nav-height: 68px; }
    .brand-portal-tag { display: none; }
    .doc-switch { margin-right: 0; }
    .nav-back span { display: none; }
    .nav-back { padding: 0.62rem 0.85rem; }
    .hero { padding-bottom: 3.5rem; }
    .rights-grid { grid-template-columns: 1fr; }
    .contact-list li { grid-template-columns: 1fr; gap: 0.1rem; }
    .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    /* Three document tabs don't fit beside the logo: give them their own row. */
    .nav-container { flex-wrap: wrap; height: auto; gap: 0.5rem; padding: 0.55rem 0.6rem 0.55rem 0.9rem; }
    .nav-brand { margin-right: auto; }
    .brand-logo { height: 30px; }
    .doc-switch { order: 3; width: 100%; justify-content: space-between; margin: 0; }
    .doc-switch a { flex: 1; padding: 0.4rem 0.5rem; font-size: 0.82rem; text-align: center; }
    .nav-back { width: 38px; height: 38px; padding: 0; justify-content: center; }
    .hero { padding-top: calc(var(--nav-height) + 4.5rem); }
    .toc ol { grid-template-columns: 1fr; }
    .doc { border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}
