/* Shared-CV page (cv.php). This used to be a <style> block inside cv.php,
   but the live server's Content-Security-Policy (style-src / font-src
   'self', set outside this repo) blocks inline styles and Google Fonts, so
   the page showed up unstyled. Same rules as before, plus the classes that
   replace its old style="" attributes; fonts are served from ./fonts. */

/* Inter (variable, the SPA's @fontsource-variable/inter files) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url(./fonts/inter-latin-ext-wght.woff2) format('woff2-variations'), url(./fonts/inter-latin-ext-wght.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url(./fonts/inter-latin-wght.woff2) format('woff2-variations'), url(./fonts/inter-latin-wght.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Poppins 600 (same files as src/fonts) */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(./fonts/poppins-latin-ext-600.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(./fonts/poppins-latin-600.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Poppins 700 (same files as src/fonts) */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(./fonts/poppins-latin-ext-700.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(./fonts/poppins-latin-700.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Poppins 800 (same files as src/fonts) */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url(./fonts/poppins-latin-ext-800.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url(./fonts/poppins-latin-800.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

/* ── Website theme tokens (exact). Light is default; .dark on <html>
      swaps to the SPA's navy palette — same mechanism as the app. ── */
:root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: linear-gradient(145deg, rgba(255,255,255,.95) 0%, rgba(248,250,252,.85) 50%, rgba(255,255,255,.9) 100%);
    --surface-solid: #ffffff;
    --surface-alt: #f8fafc;
    --text: #1e293b;
    --muted: #64748b;
    --faint: #94a3b8;
    --border: rgba(0,0,0,.08);
    --card-shadow: 0 1px 0 0 rgba(255,255,255,.8) inset, 0 4px 24px -4px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
    --accent: #1D4ED8;
    --accent-soft: rgba(29,78,216,.10);
    --grid: rgba(15,23,42,.04);
    --orb: rgba(59,130,246,.10);
}
html.dark {
    color-scheme: dark;
    --bg: #050d1a;
    --surface: linear-gradient(145deg, rgba(11,30,60,.92) 0%, rgba(15,40,71,.88) 50%, rgba(11,30,60,.90) 100%);
    --surface-solid: #0b1e3c;
    --surface-alt: #0f2847;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --faint: #64748b;
    --border: rgba(255,255,255,.10);
    --card-shadow: 0 1px 0 0 rgba(255,255,255,.04) inset, 0 4px 24px -4px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.2);
    --accent: #60A5FA;
    --accent-soft: rgba(96,165,250,.14);
    --grid: rgba(255,255,255,.035);
    --orb: rgba(96,165,250,.10);
}

/* Brand CTA gradient is identical in both modes. */
:root, html.dark { --cta: linear-gradient(135deg, #60a5fa 0%, #1D4ED8 50%, #06b6d4 100%); }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image:
        radial-gradient(900px 480px at 100% -8%, var(--orb), transparent 60%),
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 100% 100%, 56px 56px, 56px 56px;
    background-attachment: fixed;
}
h1, h2, .brand b { font-family: 'Poppins', 'Inter', sans-serif; }
a { color: inherit; }

/* ── Top bar ── */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    height: 60px; padding: 0 18px;
    background: var(--surface-solid);
    border-bottom: 1px solid var(--border);
}
@supports (backdrop-filter: blur(1px)) {
    .topbar { background: color-mix(in srgb, var(--surface-solid) 75%, transparent);
              backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand .logo {
    width: 34px; height: 34px; border-radius: 10px; color: #fff; font-weight: 800; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    /* same gradient as the SPA's BrandMark (electric → purple-glow) */
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    box-shadow: 0 6px 16px rgba(29,78,216,.30);
}
.brand b { font-size: 15px; letter-spacing: -.3px; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    width: 38px; height: 38px; border-radius: 11px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-alt); border: 1px solid var(--border); color: var(--muted);
    transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
html:not(.dark) .icon-sun { display: none; }
html.dark .icon-moon { display: none; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
    text-decoration: none; cursor: pointer; border: 1px solid transparent;
    background: var(--cta); color: #fff; box-shadow: 0 8px 22px rgba(29,78,216,.28);
    transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.sm { padding: 9px 15px; font-size: 13px; }
.btn.ghost { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── Layout ── */
.container { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 22px; box-shadow: var(--card-shadow); overflow: hidden; margin-bottom: 16px;
}
@supports (backdrop-filter: blur(1px)) {
    .card { backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); }
}

/* ── Hero ── */
.hero { padding: 26px 24px 20px; }
.hero-top { display: flex; align-items: center; gap: 16px; }
.avatar {
    width: 60px; height: 60px; border-radius: 18px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 24px; font-weight: 800; font-family: 'Poppins', sans-serif;
    background: var(--cta); box-shadow: 0 8px 22px rgba(29,78,216,.30);
}
.hero h1 { font-size: 22px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; }
.hero .pos { color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 3px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; background: var(--surface-alt);
    border: 1px solid var(--border); color: var(--muted);
}
.chip.exp { color: #b45309; background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.18); }
.chip.sal { color: #047857; background: rgba(16,185,129,.10); border-color: rgba(16,185,129,.18); }
.chip .flag { width: 20px; height: 15px; border-radius: 3px; object-fit: cover; flex-shrink: 0; }
html.dark .chip.exp { color: #fcd34d; }
html.dark .chip.sal { color: #6ee7b7; }

/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 24px 22px; }
.stat { text-align: center; padding: 14px 8px; border-radius: 14px; background: var(--surface-alt); border: 1px solid var(--border); }
.stat b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.4px; }
.stat span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); }

.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--faint); padding: 22px 24px 10px; }
.desc { padding: 0 24px 22px; color: var(--muted); font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

.notice {
    display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 14px 18px;
    border-radius: 14px; font-size: 13px; font-weight: 600;
    background: var(--accent-soft); border: 1px solid var(--border); color: var(--accent);
}

/* ── Inline CV preview ── */
.preview-wrap { padding: 14px; background: var(--surface-alt); position: relative; }
.cv-img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.cv-img.blurred { filter: blur(1.5px); user-select: none; -webkit-user-drag: none; pointer-events: none; }
/* PDF pages show ONE at a time — swipe, the arrows or the dots move
   between them, so a 3-page CV takes the space of one page. */
.pdf-viewer { display: none; position: relative; }
.pdf-pages {
    display: flex; align-items: flex-start; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
    border-radius: 12px; border: 1px solid var(--border); background: #fff;
}
.pdf-pages::-webkit-scrollbar { display: none; }
.pdf-pages:focus { outline: none; }
.pdf-page { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; background: #fff; }
.pdf-page canvas { display: block; width: 100%; height: auto; }
.pdf-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--surface-solid); color: var(--text); border: 1px solid var(--border);
    box-shadow: var(--card-shadow); cursor: pointer; padding: 0;
}
.pdf-nav svg { width: 18px; height: 18px; }
.pdf-nav.prev { left: 8px; }
.pdf-nav.next { right: 8px; }
.pdf-nav[hidden] { display: none; }
.pdf-count {
    position: absolute; top: 8px; right: 8px; z-index: 2; padding: 2px 9px; border-radius: 999px;
    background: rgba(15,23,42,.72); color: #fff; font-size: 11.5px; font-weight: 700;
    font-variant-numeric: tabular-nums; pointer-events: none;
}
.pdf-dots { display: flex; justify-content: center; gap: 6px; padding-top: 10px; }
.pdf-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: var(--border); cursor: pointer; transition: width .2s, background .2s; }
.pdf-dots button[aria-current="true"] { width: 20px; background: var(--accent); }
.pdf-loading { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 13px; font-weight: 500; padding: 14px 0 4px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 44px 24px; text-align: center; }
.empty .ic { width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; font-size: 28px; background: var(--accent-soft); color: var(--accent); }
.empty p { color: var(--muted); font-size: 13.5px; }

/* Locked: the blurred picture with the explanation on top. */
.lock-overlay {
    position: absolute; inset: 14px; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 24px; gap: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.55) 45%, rgba(255,255,255,.10) 100%);
}
html.dark .lock-overlay { background: linear-gradient(180deg, rgba(5,13,26,.10) 0%, rgba(5,13,26,.62) 45%, rgba(5,13,26,.10) 100%); }
.lock-overlay .lock {
    width: 58px; height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
    background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--card-shadow); color: var(--accent);
}
.lock-overlay .lock svg { width: 26px; height: 26px; }
.lock-overlay b { font-size: 16px; font-weight: 800; color: var(--text); }
.lock-overlay p { font-size: 13px; color: var(--muted); max-width: 340px; line-height: 1.55; }
.lock-overlay .btn { margin-top: 6px; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 18px 22px 22px; }
.foot { text-align: center; color: var(--faint); font-size: 12px; padding: 6px 0; }

.error { min-height: 64vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; }
/* Icon box — mirrors the SPA's "Company not found" placeholder:
   a soft danger-tinted rounded square with an alert icon inside. */
.error .icbox {
    width: 64px; height: 64px; border-radius: 16px;
    background: rgba(239,68,68,.10); border: 1px solid rgba(239,68,68,.15);
    display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.error .icbox svg { width: 28px; height: 28px; stroke: #ef4444; }
.error h2 { font-size: 21px; font-weight: 800; }
.error p { color: var(--muted); margin-top: 8px; max-width: 320px; line-height: 1.6; }

/* Checking a signed-in account's access: a spinner instead of the page. */
.acct-wait { display: none; position: fixed; inset: 60px 0 0; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 500; }
html.acct-check .container { visibility: hidden; }
html.acct-check .acct-wait { display: flex; }

@media (max-width: 560px) {
    .hero h1 { font-size: 20px; }
    .stat b { font-size: 17px; }
    .topbar .btn span { display: none; }
    .lock-overlay { padding: 14px; }
    .lock-overlay p { display: none; }
}

/* ── Former style="" attributes (blocked by the CSP) ── */
.brand .job {
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: #2563eb;
}
.hero-text { min-width: 0; }
.stats.cols-1 { grid-template-columns: repeat(1, 1fr); }
.stats.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stats.cols-3 { grid-template-columns: repeat(3, 1fr); }
.empty.tall { min-height: 360px; }
.error .btn { margin-top: 20px; }
.foot .site { color: var(--accent); font-weight: 700; }
