/* Computer Pro Network — Training Portal Design System */

:root {
    --brand: #cc0000;
    --brand-dark: #990000;
    --brand-darker: #660000;
    --brand-light: #fff5f5;
    --ink: #0f172a;
    --ink-muted: #334155;
    --ink-soft: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --surface-page: #eef2f7;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --topbar-height: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--ink-muted);
    background: var(--surface-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Top bar ── */
.portal-topbar {
    background: var(--ink);
    color: #fff;
    border-bottom: 3px solid var(--brand);
    position: sticky;
    top: 0;
    z-index: 300;
}

.portal-topbar-inner {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
}

.portal-brand-mini {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.portal-brand-mini:hover { color: #fff; opacity: 0.92; }

.portal-brand-mini-logo {
    height: 32px;
    width: auto;
    border-radius: 4px;
    background: #fff;
    padding: 2px;
}

.portal-topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.portal-welcome {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #cbd5e1;
    font-weight: 500;
}

.portal-welcome i { color: #94a3b8; }

.portal-topbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.portal-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.portal-btn-ghost {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.portal-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.portal-btn-ghost.active {
    background: rgba(204, 0, 0, 0.25);
    border-color: rgba(204, 0, 0, 0.45);
    color: #fff;
}

.portal-btn-admin {
    color: var(--brand-darker);
    background: linear-gradient(180deg, #ffd54f 0%, #ffb300 100%);
    border-color: rgba(0, 0, 0, 0.08);
}

.portal-btn-admin:hover {
    filter: brightness(1.03);
    color: var(--brand-darker);
}

/* ── Hero header (home page) ── */
.portal-hero {
    background: #fff;
    color: #000;
    padding: 36px 0 40px;
    border-bottom: 1px solid var(--line);
}

.portal-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}

.portal-hero-logo {
    width: 120px;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 10px;
    box-shadow: var(--shadow-md);
}

.portal-hero-text h1 {
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    color: #000;
}

.portal-hero-text p {
    margin: 0;
    font-size: 1.05rem;
    opacity: 1;
    font-weight: 400;
    max-width: 560px;
    color: #000;
}

.portal-search {
    width: 100%;
    max-width: 520px;
    display: flex;
    gap: 0;
    margin-top: 6px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.portal-search input {
    flex: 1;
    border: none;
    padding: 14px 18px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    color: var(--ink);
}

.portal-search input::placeholder { color: #64748b; }

.portal-search button {
    border: none;
    background: var(--ink);
    color: #fff;
    padding: 0 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s;
}

.portal-search button:hover { background: #1e293b; }

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    z-index: 50;
    text-align: left;
}

.portal-search-wrap { position: relative; width: 100%; max-width: 520px; }
.portal-page-header {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
    padding: 28px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.portal-page-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.portal-page-header h1 {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #fff;
    letter-spacing: -0.02em;
}

.portal-page-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

/* ── Section navigation ── */
.portal-section-nav,
.section-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
    position: sticky;
    top: var(--topbar-height);
    z-index: 200;
    box-shadow: var(--shadow-sm);
}

.portal-section-nav-inner,
.section-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.section-nav-link,
.portal-section-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    color: var(--ink-muted);
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    border: 1px solid transparent;
}

.section-nav-link:hover,
.portal-section-nav a:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
    transform: none;
}

.section-nav-link i { color: var(--brand); opacity: 0.85; }

/* ── Content sections ── */
.portal-section,
.intro {
    padding: 48px 0;
}

.intro {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.portal-section-heading,
.intro h2,
.client-companies h2,
.video-modules h2,
.local-modules h2,
.network-section h2 {
    color: var(--ink);
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
    left: auto;
    transform: none;
    text-align: center;
}

.portal-section-heading::after,
.intro h2::after,
.client-companies h2::after,
.local-modules h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--brand);
    border-radius: 2px;
    margin: 12px auto 0;
}

.intro p {
    color: var(--ink-soft);
    font-size: 1.02rem;
    line-height: 1.75;
}

/* ── Cards ── */
.client-company-card,
.module-card,
.local-module-item,
.test-card,
.network-equip-card {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s !important;
}

.client-company-card:hover,
.module-card:hover,
.test-card:hover {
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-2px) !important;
}

.client-company-card {
    border-left: 4px solid var(--brand) !important;
}

/* ── Page intro panels ── */
.page-intro {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
}

.page-intro h2 {
    color: var(--ink);
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.page-intro p { color: var(--ink-soft); margin: 0; }


/* ── Local training modules ── */
.local-modules {
    background: var(--surface-muted);
    padding: 56px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.local-modules-header {
    text-align: center;
    margin-bottom: 36px;
}

.local-modules-lead {
    max-width: 640px;
    margin: 8px auto 0;
    color: var(--ink-soft);
    font-size: 1.02rem;
    line-height: 1.65;
}

.local-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.local-modules-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.local-modules-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    color: #fff;
}

.local-modules-panel-header > i {
    font-size: 1.2rem;
    opacity: 0.95;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
}

.local-modules-panel-header h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    flex: 1;
    color: #fff;
}

.local-modules-count {
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.local-modules-items {
    list-style: none;
    margin: 0;
    padding: 14px;
    flex: 1;
}

.local-modules-items li {
    margin: 0 0 6px;
}

.local-modules-items li:last-child {
    margin-bottom: 0;
}

.local-module-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.93rem;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    border: 1px solid transparent;
}

.local-module-link:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
    border-color: rgba(204, 0, 0, 0.12);
    text-decoration: none;
}

.local-module-link::before {
    content: '\f15c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
    color: var(--brand);
    flex-shrink: 0;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}

.local-module-link:hover::before {
    background: rgba(204, 0, 0, 0.12);
    color: var(--brand-dark);
}

.local-module-link[href$=".pdf"]::before { content: '\f1c1'; }
.local-module-link[href$=".exe"]::before,
.local-module-link[href$=".bat"]::before { content: '\f019'; }
.local-module-link[href$=".reg"]::before { content: '\f013'; }
.local-module-link[href$=".zip"]::before { content: '\f1c6'; }

.local-module-link::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    padding-left: 8px;
    font-size: 0.68rem;
    color: var(--brand);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.local-module-link:hover::after {
    opacity: 1;
    transform: translateX(0);
}


/* ── Progress widgets ── */
.training-progress-card,
.progress-summary {
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    box-shadow: var(--shadow-md) !important;
}

.training-progress-banner {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand)) !important;
}

.training-progress-body {
    background: linear-gradient(180deg, var(--brand-light) 0%, var(--surface) 100px) !important;
}

.training-progress-link,
.start-btn,
.quiz-button {
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
}

/* ── Footer ── */
.portal-footer,
footer {
    background: var(--ink) !important;
    color: #cbd5e1 !important;
    padding: 40px 0 28px !important;
    margin-top: 48px;
    border-top: 3px solid var(--brand);
}

.portal-footer p,
footer p {
    opacity: 1 !important;
    color: #94a3b8;
    font-size: 0.9rem;
}

.contact-info p i { color: var(--brand) !important; }

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 6px !important;
    font-size: 1rem !important;
    transition: background 0.15s, color 0.15s !important;
    transform: none !important;
}

.social-links a:hover {
    background: var(--brand) !important;
    color: #fff !important;
}

.back-to-top {
    border-radius: 50% !important;
    width: 48px !important;
    height: 48px !important;
    box-shadow: var(--shadow-md) !important;
}

/* ── Login page ── */
body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(204, 0, 0, 0.08), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(15, 23, 42, 0.06), transparent 40%),
        var(--surface-page);
}

.login-shell {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    text-align: center;
}

.login-card .logo {
    max-width: 140px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
}

.login-card h1 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.login-card .login-subtitle {
    color: var(--ink-soft);
    font-size: 0.92rem;
    margin-bottom: 28px;
}

.login-card .form-group {
    text-align: left;
    margin-bottom: 18px;
}

.login-card label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    margin-bottom: 7px;
}

.login-card .input-container { position: relative; }

.login-card .input-container i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
}

.login-card input[type=text],
.login-card input[type=password],
.login-card input[type=email],
.login-card input[type=tel] {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-card input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.12);
}

.login-card button[type=submit] {
    width: 100%;
    margin-top: 8px;
    padding: 13px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: none;
    transform: none;
}

.login-card button[type=submit]:hover {
    background: var(--brand-dark);
    transform: none;
    box-shadow: none;
}

.login-card .error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--brand);
    color: #991b1b;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 20px;
    text-align: left;
}

.login-card .login-footer {
    margin-top: 24px;
    font-size: 0.82rem;
    color: #94a3b8;
}

/* ── Legacy header overrides ── */
header:not(.portal-page-header):not(.portal-hero) {
    background: none;
    padding: 0;
    box-shadow: none;
    position: static;
}

.user-welcome,
.home-link,
.nav-links .home-link {
    position: static;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .container { padding: 0 16px; }

    .portal-topbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-topbar-user {
        justify-content: space-between;
    }

    .portal-section-nav,
    .section-nav {
        top: 0;
        position: relative;
    }

    .portal-page-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-card { padding: 32px 24px; }
}

@media (min-width: 769px) {
    .portal-hero-inner {
        flex-direction: row;
        text-align: left;
        justify-content: space-between;
    }

    .portal-hero-brand {
        display: flex;
        align-items: center;
        gap: 20px;
        flex: 1;
    }

    .portal-search-wrap {
        flex-shrink: 0;
    }
}
