/* 
 * assets/css/access-gate.css
 * Unified FinTech Security Gate, Navigation Bar & Watermark
 * Standard: DESIGN.md (Linear & Stripe Inspired Software-Craft)
 * Basel III Vietnam Banking Risk Suite - K14 Fintech (HUIT)
 */

:root {
    --nav-bg: rgba(8, 10, 15, 0.92);
    --nav-border: rgba(255, 255, 255, 0.08);
    --nav-text: #f8fafc;
    --nav-muted: #94a3b8;
    --nav-accent: #38bdf8;
    --nav-gold: #fbbf24;
    --nav-emerald: #10b981;
    --nav-rose: #f43f5e;
}

/* Base Body Resets for Clean Layout */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* --- Top Navigation Bar --- */
.k14-top-nav {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--nav-border);
    padding: 0.55rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
    color: var(--nav-text);
    font-size: 0.825rem;
    box-sizing: border-box;
    width: 100%;
}

.k14-nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.k14-nav-hub-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #f1f5f9;
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--nav-border);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    min-height: 38px;
    box-sizing: border-box;
}

.k14-nav-hub-link:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.4);
    color: var(--nav-accent);
}

.k14-nav-dropdown {
    position: relative;
    display: inline-block;
}

.k14-nav-select {
    background: #0f1219;
    color: #f1f5f9;
    border: 1px solid var(--nav-border);
    padding: 0.4rem 0.85rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    min-height: 38px;
    box-sizing: border-box;
    max-width: 280px;
}

.k14-nav-select:hover, .k14-nav-select:focus {
    border-color: var(--nav-accent);
}

.k14-nav-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.k14-nav-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--nav-border);
    color: var(--nav-muted);
    min-height: 36px;
    box-sizing: border-box;
}

.k14-nav-badge-author {
    color: #e2e8f0;
}

.k14-nav-badge-auth {
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    transition: all 0.15s ease;
}

.k14-nav-badge-auth.authenticated {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--nav-emerald);
}

.k14-nav-badge-auth.locked {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--nav-gold);
}

/* --- Access Gate Modal Overlay --- */
.k14-gate-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
    animation: k14FadeIn 0.2s ease-out;
}

@keyframes k14FadeIn {
    from { opacity: 0; transform: scale(0.99); }
    to { opacity: 1; transform: scale(1); }
}

.k14-gate-card {
    background: #0f1219;
    border: 1px solid #1e2638;
    border-radius: 0.85rem;
    max-width: 440px;
    width: 100%;
    padding: 2rem;
    box-sizing: border-box;
    text-align: center;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.k14-gate-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.k14-gate-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.k14-gate-desc {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.k14-gate-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.k14-gate-input {
    background: #151922;
    border: 1px solid #1e2638;
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    text-align: center;
    letter-spacing: 0.05em;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 44px;
    box-sizing: border-box;
}

.k14-gate-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.k14-gate-btn {
    background: #0284c7;
    color: #ffffff;
    border: 1px solid #0369a1;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 44px;
    box-sizing: border-box;
}

.k14-gate-btn:hover {
    background: #0369a1;
}

.k14-gate-msg {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    min-height: 1.2rem;
}

.k14-gate-msg.error { color: #f43f5e; font-weight: 500; }
.k14-gate-msg.success { color: #10b981; font-weight: 500; }

.k14-gate-footer-links {
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.85rem;
}

.k14-gate-footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.15s;
}

.k14-gate-footer-links a:hover {
    color: #38bdf8;
}

/* --- Academic Watermark Footer --- */
.k14-academic-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #080a0f;
    padding: 1.5rem 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: auto;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    line-height: 1.6;
    box-sizing: border-box;
    width: 100%;
}

.k14-academic-footer strong {
    color: #cbd5e1;
}

.k14-academic-footer code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE RULES (Max Width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .k14-top-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .k14-nav-left {
        justify-content: space-between;
        width: 100%;
        gap: 0.5rem;
    }

    .k14-nav-hub-link {
        flex: 0 0 auto;
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    .k14-nav-dropdown {
        flex: 1 1 auto;
    }

    .k14-nav-select {
        width: 100%;
        max-width: 100%;
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }

    .k14-nav-right {
        justify-content: space-between;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 0.35rem;
    }

    .k14-nav-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        min-height: 32px;
    }

    .k14-nav-badge-author {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 180px;
    }

    .k14-gate-card {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
    }
}
