/**
 * Swizosoft Professional Training Portal
 * Core Design System v3.0 (Refactored for maintainability and scale)
 * 
 * Architecture: BEM (Block Element Modifier)
 * Grid: 8px baseline
 * Themes: Light (Main), Dark (Utility)
 */

/* ==========================================================================
   0. FONT REGISTRATION
   ========================================================================== */

/* Articulat CF - Headline */
@font-face {
    font-family: 'Articulat CF';
    src: url('../fonts/Articulat-Font/Articulat-Font/Articulat%20CF%20v3.2%20OTF/ArticulatCF-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Articulat CF';
    src: url('../fonts/Articulat-Font/Articulat-Font/Articulat%20CF%20v3.2%20OTF/ArticulatCF-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'Articulat CF';
    src: url('../fonts/Articulat-Font/Articulat-Font/Articulat%20CF%20v3.2%20OTF/ArticulatCF-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

/* Prata - Special */
@font-face {
    font-family: 'Prata';
    src: url('../fonts/Prata/Prata-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/* Figtree - Paragraph */
@font-face {
    font-family: 'Figtree';
    src: url('../fonts/otf/Figtree-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Figtree';
    src: url('../fonts/otf/Figtree-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'Figtree';
    src: url('../fonts/otf/Figtree-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

/* ==========================================================================
   1. VARIABLES & DESIGN TOKENS
   ========================================================================== */
:root {
    /* Brand Palette */
    --color-p-900: #070C34;
    --color-p-800: #10174a;
    --color-p-700: #1a2366;
    --color-p-600: #2A3582;
    --color-accent: #EB670E;
    --color-accent-hover: #FF8C42;
    
    /* Neutrals */
    --color-bg: #F4EEEA;
    --color-surface: #FFFFFF;
    --color-border: rgba(7, 12, 52, 0.08);
    --color-text-main: #070C34;
    --color-text-muted: #64748b;
    
    /* Status Colors */
    --color-success: #166534;
    --color-success-bg: #dcfce7;
    --color-error: #991b1b;
    --color-error-bg: #fee2e2;
    --color-warning: #854d0e;
    --color-warning-bg: #fef9c3;
    
    /* Typography Kit - Strictly Enforced */
    --font-headline: 'Articulat CF', sans-serif;
    --font-special: 'Prata', serif;
    --font-body: 'Figtree', sans-serif;
    
    /* Layout Tokens */
    --header-h: 88px;
    --sidebar-w: 300px;
    --radius-s: 8px;
    --radius-m: 16px;
    --radius-l: 32px;
    --container-w: 1280px;
    
    /* Effects */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. GLOBAL RESET & BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5 {
    font-family: var(--font-headline);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.c-nav-link {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-p-900);
    text-decoration: none;
    transition: var(--transition);
    opacity: 0.8;
}

.c-nav-link:hover {
    color: var(--color-accent);
    opacity: 1;
}

.t-special { font-family: var(--font-special); font-weight: 400; }
.t-muted { color: var(--color-text-muted); }
.t-accent { color: var(--color-accent); }
.t-upper { font-family: var(--font-special); text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.75rem; font-weight: 400; }

/* ==========================================================================
   4. UTILITIES & LAYOUT
   ========================================================================== */
/* Grid Utilities */
.l-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.l-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

/* Responsive Utilities */
@media (max-width: 1024px) {
    .l-grid-3, .l-grid-2 { grid-template-columns: 1fr; }
    .u-stack-mobile { display: grid !important; grid-template-columns: 1fr !important; gap: 24px !important; }
    .u-flex-stack-mobile { flex-direction: column !important; align-items: flex-start !important; gap: 16px !important; }
}

@media (max-width: 768px) {
    .u-hide-tablet { display: none !important; }
}

.l-container {
    width: 100%;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 24px;
}

.l-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 80px;
}
.l-header .l-container { height: 100%; }

.l-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.l-portal {
    display: flex;
    min-height: calc(100vh - 80px);
}

.l-sidebar {
    width: var(--sidebar-w);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.l-main {
    flex: 1;
    padding: 48px;
    background: #f8fafc;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .l-header { height: 72px; }
    .l-header__inner { padding: 0 24px; }
    
    .c-nav-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        font-size: 1.75rem;
        color: var(--color-p-900);
        cursor: pointer;
        z-index: 3000;
        width: 40px;
        height: 40px;
    }

    .u-hide-small { display: none !important; }
}

@media (max-width: 1024px) and (min-width: 480px) {
    .u-hide-small { display: block !important; }
}

@media (max-width: 1024px) {
    .l-header__nav {
        position: fixed;
        top: 72px;
        left: 0;
        width: 100%;
        height: calc(100vh - 72px);
        background: var(--color-surface);
        padding: 40px 24px;
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
        display: none;
        flex-direction: column;
        align-items: center;
        text-align: center;
        z-index: 2000;
        overflow-y: auto;
    }

    .l-header__nav.is-active {
        display: flex !important;
    }

    .c-nav-link {
        font-size: 1rem !important;
        padding: 12px 0;
        width: 100%;
        font-weight: 600;
    }

    .l-sidebar {
        top: 72px;
        height: calc(100vh - 72px);
    }

    .l-footer__bottom {
        flex-direction: column !important;
        text-align: center;
        gap: 32px !important;
    }

    .l-footer__social-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .l-footer__social {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        gap: 24px !important;
    }

    .mobile-column {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 20px !important;
    }

    .u-mt-mobile-16 {
        margin-top: 16px;
        border-top: 1px solid var(--color-border);
        padding-top: 24px;
    }

    .l-portal { flex-direction: column; }
    
    .l-sidebar {
        position: fixed;
        top: 80px;
        left: 0;
        width: 280px;
        height: calc(100vh - 80px);
        background: white;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 24px;
        border-right: 1px solid var(--color-border);
        display: flex;
        flex-direction: column;
    }

    .l-sidebar.is-active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }

    .l-main { padding: 24px 16px; width: 100%; }
    
    .u-hide-mobile { display: none !important; }
    .u-show-mobile { display: block !important; }
}

.u-show-mobile { display: none; }
.u-hide-mobile { display: block; }

.c-nav-toggle { display: none; }
@media (min-width: 1025px) {
    .l-header__nav { 
        display: flex; 
        align-items: center; 
        gap: 40px;
        margin-left: auto;
    }
}
.u-gap-24 { gap: 24px; }

/* ==========================================================================
   5. UI COMPONENTS
   ========================================================================== */

/* Buttons */
.c-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 4px;
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.c-btn--primary {
    background: var(--color-p-600);
    color: var(--color-surface);
}

.c-btn--primary:hover {
    background: var(--color-p-900);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.c-btn--accent {
    background: var(--color-accent);
    color: var(--color-surface);
}

.c-btn--accent:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.c-btn--outline {
    background: transparent;
    border-color: var(--color-p-600);
    color: var(--color-p-600);
}

.c-btn--outline:hover {
    background: var(--color-p-600);
    color: var(--color-surface);
}

.c-btn--ghost {
    background: transparent;
    color: var(--color-text-main);
}

.c-btn--ghost:hover {
    background: var(--color-bg);
}

.c-card {
    background: var(--color-surface);
    border-radius: var(--radius-m);
    padding: 48px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

@media (max-width: 768px) {
    .c-card { padding: 24px !important; }
}

.c-card--hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-p-600);
}

/* Inputs & Forms */
.c-form-group { margin-bottom: 24px; }
.c-form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--color-p-600);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.c-input {
    width: 100%;
    padding: 14px 16px;
    background: #fcfcfc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-s);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.c-form-group {
    margin-bottom: 24px;
}

.c-form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-p-900);
    margin-bottom: 12px;
}

.c-input:focus {
    outline: none;
    border-color: var(--color-p-600);
    background: var(--color-surface);
    box-shadow: 0 0 0 4px rgba(42, 53, 130, 0.1);
}

/* Badges */
.c-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.c-badge--success { background: var(--color-success-bg); color: var(--color-success); }
.c-badge--pending { background: var(--color-warning-bg); color: var(--color-warning); }
.c-badge--error { background: var(--color-error-bg); color: var(--color-error); }

/* ==========================================================================
   6. NAVIGATION
   ========================================================================== */
.c-nav-link {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 0.93rem;
    color: var(--color-text-main);
    text-decoration: none;
    opacity: 0.75;
    transition: var(--transition);
}

.c-nav-link:hover { opacity: 1; color: var(--color-accent); }

@media (max-width: 1024px) {
    .c-nav-link {
        display: block;
        width: 100%;
        padding: 16px 0;
        font-size: 1.25rem;
        text-align: center;
    }
}

.c-side-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-s);
    color: var(--color-text-muted);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.c-side-item:hover { background: var(--color-bg); color: var(--color-p-600); }
.c-side-item--active { background: var(--color-p-600); color: var(--color-surface); }

/* ==========================================================================
   7. SECTIONS & UTILITIES
   ========================================================================== */
/* Utilities */
.u-flex { display: flex; }
.u-flex-column { flex-direction: column; }
.u-flex-center { align-items: center; }
.u-flex-between { justify-content: space-between; }
.u-flex-start { align-items: flex-start; }
.u-gap-16 { gap: 16px; }
.u-gap-8 { gap: 8px; }
.u-mt-32 { margin-top: 32px; }
.u-mb-32 { margin-bottom: 32px; }
.u-text-center { text-align: center; }
.u-w-full { width: 100%; }
.u-overflow-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hidden { display: none !important; }

/* Grid Systems */
.l-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.l-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

@media (max-width: 1024px) {
    .l-grid-2, .l-grid-3 { grid-template-columns: 1fr !important; }
    .l-grid-2 > *, .l-grid-3 > * { grid-column: span 1 !important; }
}

/* Password Strength Indicator */
.c-password-meter {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.c-password-meter__bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

.c-password-meter__text {
    font-size: 0.7rem;
    font-weight: 800;
    margin-top: 4px;
    text-transform: uppercase;
}

/* Visibility Toggle */
.c-password-wrapper {
    position: relative;
}

.c-password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--color-text-muted);
    z-index: 10;
    font-size: 1.1rem;
}

.c-password-toggle:hover {
    color: var(--color-p-600);
}

.c-password-requirements {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.c-password-requirement {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.c-password-requirement i {
    font-size: 0.85rem;
    color: #e2e8f0;
}

.c-password-requirement--valid {
    color: var(--color-success);
}

.c-password-requirement--valid i {
    color: var(--color-success);
}

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

/* Hero Component */
.c-hero {
    min-height: 80vh;
    background: var(--color-p-900);
    color: var(--color-surface);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.c-hero__content { max-width: 800px; z-index: 1; }
.c-hero__title { font-size: 4.5rem; line-height: 1.1; margin-bottom: 24px; }
.c-hero__text { font-size: 1.25rem; opacity: 0.8; margin-bottom: 40px; }

@media (max-width: 768px) {
    .c-hero { min-height: 60vh; padding: 120px 0 60px; }
    .c-hero__title { font-size: 2.5rem; }
    .c-hero__text { font-size: 1rem; }
    .u-flex.u-gap-16 { flex-direction: column; width: 100%; }
    .c-btn { width: 100%; }
}

/* Stat Box */
.c-stat-box {
    background: var(--color-surface);
    padding: 32px;
    border-radius: var(--radius-m);
    border-left: 4px solid var(--color-p-600);
}

.c-stat-box__label { font-size: 0.75rem; font-weight: 800; color: var(--color-text-muted); text-transform: uppercase; }
.c-stat-box__value { font-size: 3rem; font-weight: 800; color: var(--color-p-900); display: block; margin-top: 8px; }

/* Dashboard Cards List */
.c-dash-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-m);
    margin-bottom: 16px;
    transition: var(--transition);
}

.c-dash-item:hover { border-color: var(--color-p-600); transform: translateX(8px); }

/* Table */
.c-table-wrapper { border-radius: var(--radius-s); border: 1px solid var(--color-border); overflow: hidden; background: var(--color-surface); }
.c-table { width: 100%; border-collapse: collapse; }
.c-table th { background: #f8fafc; padding: 16px; text-align: left; font-size: 0.75rem; font-weight: 800; color: var(--color-p-600); text-transform: uppercase; }
.c-table td { padding: 16px; border-top: 1px solid var(--color-border); font-size: 0.9375rem; }

/* Flash Messages */
.c-flash { padding: 16px 24px; border-radius: var(--radius-s); font-weight: 700; display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.c-flash--success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid #bbf7d0; }
.c-flash--error { background: var(--color-error-bg); color: var(--color-error); border: 1px solid #fecaca; }

.l-footer__bottom {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.l-footer__copy {
    font-size: 0.8rem;
    opacity: 0.5;
}

.l-footer__social-wrapper {
    display: flex;
    flex-direction: column;
}

.social-label {
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--color-accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.l-footer__social .social-link {
    color: white;
    opacity: 0.5;
    font-size: 1.5rem;
    transition: var(--transition);
}

.l-footer__social .social-link:hover {
    opacity: 1;
    color: var(--color-accent);
}

/* Profile Card */
.c-profile-mini { padding: 16px; background: var(--color-bg); border-radius: var(--radius-s); display: flex; align-items: center; gap: 12px; }
.c-profile-mini__avatar { width: 44px; height: 44px; background: var(--color-p-600); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--font-headline); }
.c-profile-mini__name { font-weight: 800; font-size: 0.875rem; }
.c-profile-mini__role { font-size: 0.6875rem; color: var(--color-text-muted); font-weight: 700; }
