/* ==========================================================================
   NOS Phase 3 — High-Impact Page Styles
   Split-Screen Login | Bento Dashboards | Siswa SVG Menu | CBT 2-Col Exam | AI
   ========================================================================== */

@media screen {
    /* ======================================================================
       1. SPLIT-SCREEN EXECUTIVE EMERALD LOGIN
       ====================================================================== */
    body.nos-auth-page {
        min-height: 100vh;
        margin: 0;
        background: var(--nos-canvas);
        color: var(--nos-text);
        font-family: var(--nos-font-sans);
    }

    .nos-auth-layout {
        min-height: 100vh;
        display: grid;
        grid-template-columns: 1.05fr 1fr;
    }

    .nos-auth-showcase {
        position: relative;
        background: linear-gradient(145deg, #064E3B 0%, #047857 55%, #065F46 100%);
        color: #ffffff;
        padding: 3rem 3.25rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        overflow: hidden;
    }

    .nos-auth-showcase::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image:
            radial-gradient(circle at 86% 14%, rgba(245, 158, 11, 0.24) 0%, transparent 42%),
            radial-gradient(circle at 12% 88%, rgba(52, 211, 153, 0.20) 0%, transparent 46%),
            linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
        background-size: auto, auto, 44px 44px, 44px 44px;
        pointer-events: none;
    }

    .nos-auth-showcase > * {
        position: relative;
        z-index: 1;
    }

    .nos-auth-brand-row {
        display: flex;
        align-items: center;
        gap: 0.9rem;
    }

    .nos-auth-logo-box {
        width: 56px;
        height: 56px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.96);
        padding: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
        flex-shrink: 0;
    }

    .nos-auth-logo-box img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 10px;
    }

    .nos-auth-hero {
        max-width: 470px;
        margin: 2rem 0;
    }

    .nos-auth-kicker {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        padding: 0.3rem 0.8rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.12);
        border: 1px solid rgba(255, 255, 255, 0.22);
        font-size: 0.74rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #FDE68A;
        margin-bottom: 1.1rem;
    }

    .nos-auth-hero h1 {
        color: #ffffff;
        font-size: 2.05rem;
        font-weight: 700;
        line-height: 1.22;
        letter-spacing: -0.025em;
        margin-bottom: 0.85rem;
    }

    .nos-auth-hero p {
        color: rgba(236, 253, 245, 0.88);
        font-size: 0.94rem;
        line-height: 1.65;
        margin-bottom: 1.6rem;
    }

    .nos-auth-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 0.55rem;
    }

    .nos-auth-pill {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        padding: 0.42rem 0.8rem;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.10);
        border: 1px solid rgba(255, 255, 255, 0.18);
        font-size: 0.78rem;
        font-weight: 600;
        color: #ECFDF5;
    }

    .nos-auth-form-pane {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2.25rem 1.5rem;
        background: var(--nos-canvas);
    }

    .nos-auth-card {
        width: 100%;
        max-width: 420px;
        background: var(--nos-surface);
        border: 1px solid var(--nos-border);
        border-radius: var(--nos-radius-xl);
        box-shadow: var(--nos-shadow-md);
        padding: 2rem 1.85rem;
    }

    .nos-auth-mobile-brand {
        display: none;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 1.25rem;
    }

    .nos-auth-field {
        margin-bottom: 1rem;
    }

    .nos-auth-field label {
        display: block;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--nos-text-secondary);
        margin-bottom: 0.35rem;
    }

    .nos-auth-input-wrap {
        position: relative;
        display: flex;
        align-items: center;
    }

    .nos-auth-input-icon {
        position: absolute;
        left: 13px;
        color: var(--nos-text-muted);
        pointer-events: none;
        display: inline-flex;
    }

    .nos-auth-input-wrap .form-control {
        height: 46px;
        padding-left: 40px;
        padding-right: 42px;
        border-radius: 10px;
        font-size: 0.92rem;
    }

    .nos-auth-eye {
        position: absolute;
        right: 10px;
        background: transparent;
        border: none;
        color: var(--nos-text-muted);
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .nos-auth-eye:hover {
        background: var(--nos-surface-hover);
        color: var(--nos-primary);
    }

    /* Clean pill switch for CBT Mode */
    .nos-switch-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.65rem 0.85rem;
        border-radius: 10px;
        background: var(--nos-surface-subtle);
        border: 1px solid var(--nos-border);
        margin-bottom: 1.25rem;
        cursor: pointer;
    }

    .nos-switch {
        position: relative;
        width: 42px;
        height: 24px;
        flex-shrink: 0;
    }

    .nos-switch input {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }

    .nos-switch-slider {
        position: absolute;
        inset: 0;
        background: var(--nos-border-strong);
        border-radius: 999px;
        transition: background 180ms ease;
    }

    .nos-switch-slider::before {
        content: '';
        position: absolute;
        width: 18px;
        height: 18px;
        left: 3px;
        top: 3px;
        border-radius: 50%;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
        transition: transform 180ms ease;
    }

    .nos-switch input:checked + .nos-switch-slider {
        background: var(--nos-primary);
    }

    .nos-switch input:checked + .nos-switch-slider::before {
        transform: translateX(18px);
    }

    .nos-auth-status {
        border-radius: 10px;
        padding: 0.65rem 0.85rem;
        font-size: 0.84rem;
        font-weight: 600;
        margin-bottom: 1rem;
        display: none;
        align-items: center;
        gap: 0.55rem;
    }

    .nos-auth-status.is-visible { display: flex; }
    .nos-auth-status.is-info    { background: var(--nos-info-soft); color: var(--nos-info); border: 1px solid var(--nos-info-border); }
    .nos-auth-status.is-success { background: var(--nos-success-soft); color: var(--nos-success); border: 1px solid var(--nos-success-border); }
    .nos-auth-status.is-danger  { background: var(--nos-danger-soft); color: var(--nos-danger); border: 1px solid var(--nos-danger-border); }

    .nos-auth-submit {
        height: 46px;
        width: 100%;
        border-radius: 10px !important;
        font-size: 0.94rem !important;
        font-weight: 700 !important;
    }

    @media (max-width: 991.98px) {
        .nos-auth-layout { grid-template-columns: 1fr; }
        .nos-auth-showcase { display: none; }
        .nos-auth-mobile-brand { display: flex; }
        .nos-auth-form-pane {
            background:
                radial-gradient(circle at 15% 12%, rgba(4, 120, 87, 0.12) 0%, transparent 45%),
                radial-gradient(circle at 88% 85%, rgba(217, 119, 6, 0.08) 0%, transparent 42%),
                var(--nos-canvas);
        }
        .nos-auth-card { padding: 1.65rem 1.35rem; }
    }

    /* ======================================================================
       2. BENTO EXECUTIVE DASHBOARD (ADMIN & GURU)
       ====================================================================== */
    .nos-welcome-banner {
        background: linear-gradient(135deg, #064E3B 0%, #047857 62%, #059669 100%);
        border-radius: var(--nos-radius-lg);
        padding: 1.25rem 1.45rem;
        color: #ffffff;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1.15rem;
        position: relative;
        overflow: hidden;
    }

    .nos-welcome-banner::after {
        content: '';
        position: absolute;
        right: -30px;
        top: -30px;
        width: 180px;
        height: 180px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(245, 158, 11, 0.28) 0%, transparent 70%);
        pointer-events: none;
    }

    .nos-welcome-title {
        font-size: 1.22rem;
        font-weight: 700;
        color: #ffffff;
        margin: 0 0 0.2rem;
        letter-spacing: -0.02em;
    }

    .nos-welcome-sub {
        font-size: 0.83rem;
        color: rgba(236, 253, 245, 0.88);
        margin: 0;
    }

    .nos-welcome-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem;
        position: relative;
        z-index: 1;
    }

    .nos-welcome-btn {
        background: rgba(255, 255, 255, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.26);
        color: #ffffff !important;
        border-radius: 9px;
        padding: 0.42rem 0.8rem;
        font-size: 0.78rem;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        text-decoration: none !important;
        transition: background var(--nos-transition);
    }

    .nos-welcome-btn:hover {
        background: rgba(255, 255, 255, 0.24);
    }

    /* Bento KPI Grid */
    .nos-kpi-grid {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0.85rem;
        margin-bottom: 1.15rem;
    }

    .nos-kpi-grid.cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    @media (max-width: 1199.98px) {
        .nos-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    }

    @media (max-width: 575.98px) {
        .nos-kpi-grid,
        .nos-kpi-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
    }

    .nos-kpi-card {
        background: var(--nos-surface);
        border: 1px solid var(--nos-border);
        border-radius: var(--nos-radius-lg);
        padding: 0.95rem 1rem;
        box-shadow: var(--nos-shadow-xs);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 0.65rem;
        text-decoration: none !important;
        color: var(--nos-text) !important;
        transition: transform var(--nos-transition), box-shadow var(--nos-transition), border-color var(--nos-transition);
    }

    .nos-kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--nos-shadow-md);
        border-color: var(--nos-primary-border);
    }

    .nos-kpi-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .nos-kpi-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .nos-kpi-icon.tone-emerald { background: var(--nos-primary-soft); color: var(--nos-primary); }
    .nos-kpi-icon.tone-blue    { background: var(--nos-info-soft); color: var(--nos-info); }
    .nos-kpi-icon.tone-gold    { background: var(--nos-accent-soft); color: var(--nos-accent); }
    .nos-kpi-icon.tone-purple  { background: rgba(124, 58, 237, 0.12); color: #7C3AED; }
    .nos-kpi-icon.tone-green   { background: var(--nos-success-soft); color: var(--nos-success); }
    .nos-kpi-icon.tone-rose    { background: var(--nos-danger-soft); color: var(--nos-danger); }

    .nos-kpi-value {
        font-size: 1.55rem;
        font-weight: 700;
        line-height: 1.1;
        color: var(--nos-text);
        font-variant-numeric: tabular-nums;
    }

    .nos-kpi-label {
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--nos-text-muted);
    }

    /* Executive Live Token Tile */
    .nos-token-tile {
        background: var(--nos-accent-soft);
        border: 1px solid var(--nos-accent-border);
        border-radius: var(--nos-radius-md);
        padding: 0.75rem 0.95rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
    }

    .nos-token-code {
        font-family: var(--nos-font-mono);
        font-size: 1.35rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        color: var(--nos-accent-hover);
    }

    [data-theme="dark"] .nos-token-code {
        color: #FBBF24;
    }

    .nos-pill-scroll {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.3rem;
        padding: 0.65rem 0.85rem;
        border-bottom: 1px solid var(--nos-divider);
        -webkit-overflow-scrolling: touch;
    }

    .nos-pill-scroll .nav-link {
        white-space: nowrap;
        padding: 0.3rem 0.7rem;
        font-size: 0.76rem;
    }

    /* ======================================================================
       3. PORTAL SISWA — SQUIRCLE SVG MENU GRID & EXAM CARDS
       ====================================================================== */
    .nos-siswa-menu-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
        gap: 0.85rem;
    }

    @media (max-width: 575.98px) {
        .nos-siswa-menu-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.65rem;
        }
    }

    .nos-siswa-tile {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 0.55rem;
        padding: 1rem 0.65rem;
        border-radius: var(--nos-radius-md);
        background: var(--nos-surface-subtle);
        border: 1px solid var(--nos-border);
        color: var(--nos-text) !important;
        text-decoration: none !important;
        transition: transform var(--nos-transition), border-color var(--nos-transition), box-shadow var(--nos-transition), background var(--nos-transition);
    }

    .nos-siswa-tile:hover {
        transform: translateY(-3px);
        background: var(--nos-surface);
        border-color: var(--nos-primary-border);
        box-shadow: var(--nos-shadow-md);
    }

    .nos-siswa-tile-icon {
        width: 50px;
        height: 50px;
        border-radius: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform var(--nos-transition);
    }

    .nos-siswa-tile:hover .nos-siswa-tile-icon {
        transform: scale(1.06);
    }

    .nos-siswa-tile-label {
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.25;
        color: var(--nos-text);
    }

    /* Modern Exam Schedule Card (Siswa CBT List) */
    .nos-exam-card {
        background: var(--nos-surface);
        border: 1px solid var(--nos-border);
        border-radius: var(--nos-radius-lg);
        box-shadow: var(--nos-shadow-xs);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        height: 100%;
        transition: transform var(--nos-transition), box-shadow var(--nos-transition), border-color var(--nos-transition);
    }

    .nos-exam-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--nos-shadow-md);
        border-color: var(--nos-primary-border);
    }

    .nos-exam-card-top {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--nos-divider);
        background: var(--nos-surface-subtle);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        font-size: 0.76rem;
        font-weight: 600;
        color: var(--nos-text-secondary);
    }

    .nos-exam-card-body {
        padding: 1rem;
        flex: 1;
    }

    .nos-exam-card-title {
        font-size: 1rem;
        font-weight: 700;
        color: var(--nos-text);
        margin: 0 0 0.35rem;
        line-height: 1.3;
    }

    .nos-exam-card-foot {
        padding: 0.75rem 1rem;
        border-top: 1px solid var(--nos-divider);
        background: var(--nos-surface-subtle);
    }

    /* ======================================================================
       4. CBT LIVE EXAM WORKSPACE (2-COL DESKTOP + NORMALIZED GRID)
       ====================================================================== */
    .nos-exam-workspace {
        max-width: 1200px;
        margin: 0 auto;
    }

    .nos-exam-progress-bar {
        height: 5px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.24);
        overflow: hidden;
        margin-top: 6px;
    }

    .nos-exam-progress-fill {
        height: 100%;
        width: 0%;
        border-radius: 999px;
        background: #FBBF24;
        transition: width 240ms ease;
    }

    .nos-font-stepper {
        display: inline-flex;
        align-items: center;
        border: 1px solid var(--nos-border);
        border-radius: var(--nos-radius-sm);
        background: var(--nos-surface-subtle);
        overflow: hidden;
    }

    .nos-font-stepper button {
        border: none;
        background: transparent;
        color: var(--nos-text-secondary);
        font-size: 0.76rem;
        font-weight: 700;
        padding: 0.28rem 0.55rem;
        cursor: pointer;
    }

    .nos-font-stepper button:hover {
        background: var(--nos-primary-soft);
        color: var(--nos-primary);
    }

    .nos-timer-warning {
        background: var(--nos-warning-soft) !important;
        border-color: var(--nos-warning-border) !important;
        color: var(--nos-warning-hover) !important;
    }

    .nos-timer-critical {
        background: var(--nos-danger-soft) !important;
        border-color: var(--nos-danger) !important;
        color: var(--nos-danger) !important;
        animation: nosPulse 1.2s ease-in-out infinite;
    }

    @keyframes nosPulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.28); }
        50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
    }

    .nos-palette-card {
        position: sticky;
        top: 76px;
    }

    .nos-palette-grid {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .nos-palette-btn {
        position: relative;
        height: 44px;
        border-radius: 10px;
        border: 1.5px solid var(--nos-border-strong);
        background: var(--nos-surface-subtle);
        color: var(--nos-text);
        font-weight: 700;
        font-size: 0.85rem;
        font-variant-numeric: tabular-nums;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all var(--nos-transition);
    }

    .nos-palette-btn:hover {
        border-color: var(--nos-primary);
        background: var(--nos-primary-soft);
        color: var(--nos-primary);
    }

    .nos-palette-btn.is-answered {
        background: var(--nos-primary);
        border-color: var(--nos-primary);
        color: #ffffff;
    }

    .nos-palette-btn.is-current {
        box-shadow: 0 0 0 3px var(--nos-accent);
        border-color: var(--nos-accent);
    }

    .nos-palette-ans {
        position: absolute;
        top: -6px;
        right: -6px;
        min-width: 20px;
        height: 20px;
        padding: 0 4px;
        border-radius: 999px;
        background: var(--nos-accent);
        color: #ffffff;
        font-size: 0.66rem;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 2px solid var(--nos-surface);
    }

    .nos-palette-legend {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        font-size: 0.74rem;
        color: var(--nos-text-muted);
        margin-bottom: 0.85rem;
    }

    .nos-legend-dot {
        width: 10px;
        height: 10px;
        border-radius: 3px;
        display: inline-block;
        margin-right: 4px;
        vertical-align: middle;
    }

    /* ======================================================================
       5. AI CHAT & KNOWLEDGE — EXECUTIVE EMERALD TOKEN HARMONIZATION
       ====================================================================== */
    .ai-chat-shell {
        border-color: var(--nos-border) !important;
        border-radius: var(--nos-radius-lg) !important;
        background: var(--nos-surface) !important;
        box-shadow: var(--nos-shadow-sm);
    }

    .ai-chat-sidebar {
        background: var(--nos-surface-subtle) !important;
        border-right-color: var(--nos-border) !important;
    }

    .ai-chat-sidebar-header,
    .ai-chat-topbar {
        background: var(--nos-surface) !important;
        border-bottom-color: var(--nos-border) !important;
    }

    .ai-chat-main {
        background: var(--nos-surface) !important;
    }

    .ai-session-item:hover {
        background: var(--nos-surface-hover) !important;
    }

    .ai-session-item.active {
        background: var(--nos-primary-soft) !important;
        border-color: var(--nos-primary-border) !important;
    }

    .ai-session-title {
        color: var(--nos-text) !important;
    }

    .ai-skill-card {
        background: var(--nos-surface) !important;
        border-color: var(--nos-border) !important;
        border-radius: var(--nos-radius-md) !important;
    }

    .ai-skill-card:hover {
        border-color: var(--nos-primary) !important;
        box-shadow: var(--nos-shadow-md) !important;
    }

    .ai-msg-row.user .ai-msg-avatar {
        background: var(--nos-primary) !important;
    }

    .ai-msg-row.assistant .ai-msg-avatar {
        background: var(--nos-accent) !important;
    }

    .ai-md-h {
        color: var(--nos-text) !important;
    }

    .ai-md-quote {
        border-left-color: var(--nos-primary) !important;
        background: var(--nos-primary-soft) !important;
        color: var(--nos-text-secondary) !important;
    }

    .ai-md-table {
        background: var(--nos-surface) !important;
        color: var(--nos-text) !important;
    }

    .ai-md-table th {
        background: var(--nos-table-head-bg) !important;
    }

    .kba-code-mono {
        color: var(--nos-primary) !important;
    }

    .kba-chunk-card {
        background: var(--nos-surface-subtle) !important;
        border-left-color: var(--nos-primary) !important;
    }
}
