:root {
    --navy: #0f2044;
    --navy-mid: #1a3a6b;
    --navy-light: #1e4d8c;
    --red: #b30000;
    --red-bright: #c41e3a;
    --gold: #ffd700;
    --gold-soft: #ffe566;
    --accent: #0ea5e9;
    --accent-green: #10b981;
    --gradient-header: linear-gradient(90deg, #0f2044 0%, #1a3a6b 35%, #1e4d8c 65%, #b30000 100%);
    --gradient-banner: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 50%, #6bcf7f 100%);
    --gradient-btn: linear-gradient(135deg, #1e4d8c, #0f2044);
    --glass: rgba(255, 255, 255, 0.92);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text: #1a2b3c;
    --text-muted: #5a6b7d;
    --border: #e2e8f0;
    --shadow: 0 24px 48px rgba(15, 32, 68, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --font: 'Be Vietnam Pro', system-ui, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    min-height: 100vh;
    padding-top: 88px;
    line-height: 1.6;
    background: #0a1628;
}

.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(rgba(15, 32, 68, 0.82), rgba(15, 32, 68, 0.75)),
        url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920&q=80') center/cover no-repeat fixed;
}

.digital-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
}

/* Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--gradient-header);
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
}

.top-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.top-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: white;
}

.logo-emblem {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo-emblem svg {
    width: 100%;
    height: 100%;
}

.top-logo-text h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.top-logo-text p {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 500;
}

.nav-menu {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.25s ease;
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.25rem;
    cursor: pointer;
}

.page-main {
    padding: 24px 16px 120px;
}

/* Card container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 32px 32px;
    background: var(--glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.page-header .emblem-lg {
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    background: linear-gradient(145deg, var(--gold-soft), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--red-bright);
    box-shadow: 0 12px 28px rgba(196, 30, 58, 0.2);
}

.page-header .emblem-lg svg {
    width: 48px;
    height: 48px;
}

.page-header h1 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 12px;
}

.digital-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: rgba(14, 165, 233, 0.1);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
    border: 1px solid rgba(14, 165, 233, 0.25);
}

.banner-danhoi {
    margin-top: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    background: var(--gradient-banner);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.banner-danhoi-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.banner-danhoi h2 {
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    margin: 0;
}

.banner-danhoi p {
    color: white;
    font-size: 0.85rem;
    margin-top: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.banner-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.banner-icon i {
    font-size: 1.1rem;
}

.banner-icon.people i { color: #ff6b6b; }
.banner-icon.gov i { color: #6bcf7f; }

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group > label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--navy);
}

.form-group > label i {
    color: var(--navy-light);
    width: 18px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--navy-light);
    background: white;
    box-shadow: 0 0 0 4px rgba(30, 77, 140, 0.12);
}

textarea.form-control {
    min-height: 180px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-card {
    flex: 1 1 calc(50% - 6px);
    min-width: 140px;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-card label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    background: #f8fafc;
    transition: all 0.2s;
}

.radio-card input:checked + label {
    border-color: var(--navy-light);
    background: rgba(30, 77, 140, 0.08);
    color: var(--navy);
    box-shadow: 0 0 0 3px rgba(30, 77, 140, 0.1);
}

.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    border: 2px dashed var(--navy-light);
    border-radius: var(--radius-sm);
    background: rgba(30, 77, 140, 0.04);
    color: var(--navy);
    font-weight: 500;
    transition: all 0.2s;
}

.file-upload:hover .file-upload-label {
    background: rgba(30, 77, 140, 0.08);
    border-color: var(--navy);
}

.file-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
}

.btn-primary {
    background: var(--gradient-btn);
    color: white;
    box-shadow: 0 8px 24px rgba(15, 32, 68, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 32, 68, 0.45);
}

.btn-secondary {
    background: white;
    color: var(--text-muted);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.875rem;
}

/* Success panel */
.success-panel {
    display: none;
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: var(--radius);
    margin-bottom: 24px;
    animation: fadeUp 0.4s ease;
}

.success-panel.visible {
    display: block;
}

.success-panel h3 {
    font-size: 1.25rem;
    margin: 12px 0;
}

.ma-ho-so {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin: 12px 0;
}

.qr-box {
    background: white;
    padding: 20px;
    border-radius: var(--radius-sm);
    margin: 20px auto;
    max-width: 280px;
}

.qr-box img {
    max-width: 100%;
    border-radius: 8px;
}

.lookup-tips {
    text-align: left;
    background: rgba(255, 255, 255, 0.15);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: 0.9rem;
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* Tra cứu tabs */
.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    border-color: var(--navy-light);
    background: rgba(30, 77, 140, 0.1);
    color: var(--navy);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeUp 0.3s ease;
}

.hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.qr-scanner-wrap {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-height: 200px;
    background: #0f172a;
}

#qr-reader {
    width: 100%;
}

.qr-upload-zone {
    text-align: center;
    padding: 32px 20px;
}

.or-divider {
    text-align: center;
    color: var(--text-muted);
    margin: 16px 0;
    font-weight: 600;
}

/* Result cards */
.result-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-top: 16px;
    background: #f8fafc;
}

.result-card h4 {
    color: var(--navy);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-new { background: #dbeafe; color: #1d4ed8; }
.status-processing { background: #fef3c7; color: #b45309; }
.status-done { background: #d1fae5; color: #047857; }
.status-rejected { background: #fee2e2; color: #b91c1c; }

.meta-grid {
    display: grid;
    gap: 8px;
    font-size: 0.9rem;
}

.meta-grid dt {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.meta-grid dd {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-all !important;
    white-space: pre-wrap !important;
    max-width: 100% !important;
}

/* Tuyên truyền */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.doc-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.doc-item:hover {
    border-color: var(--navy-light);
    box-shadow: 0 8px 20px rgba(15, 32, 68, 0.08);
}

.doc-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--navy-light), var(--navy));
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.doc-body h3 {
    font-size: 1rem;
    color: var(--navy);
    margin-bottom: 6px;
}

.doc-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.doc-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.doc-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: white;
}

.faq-item summary {
    padding: 16px 20px;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
    color: var(--navy-light);
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    transform: rotate(180deg);
}

.faq-item .faq-answer {
    padding: 0 20px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin: 0 20px 16px;
}

/* Footer */
.site-footer {
    background: linear-gradient(160deg, var(--navy) 0%, #0a1628 100%);
    color: rgba(255, 255, 255, 0.9);
    padding: 48px 20px 24px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
}

.footer-section h3 {
    color: var(--gold);
    font-size: 1rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section p,
.footer-meta {
    font-size: 0.875rem;
    line-height: 1.8;
    opacity: 0.9;
}

.footer-meta a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.footer-meta a:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.75;
}

.footer-dev {
    margin-top: 8px;
    color: var(--accent);
    opacity: 1;
}

.admin-link {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    background: rgba(15, 32, 68, 0.95);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: transform 0.2s, background 0.2s;
    border: 2px solid rgba(255, 215, 0, 0.4);
}

.admin-link:hover {
    transform: scale(1.08);
    background: var(--navy-light);
}

.nav-admin-mobile {
    display: none;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--navy-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    body {
        padding-top: 72px;
    }

    .top-header-content {
        position: relative;
        flex-direction: column;
        gap: 12px;
        padding: 12px 20px;
    }

    .top-logo {
        width: 100%;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }

    .logo-emblem {
        width: 55px !important;
        height: 55px !important;
    }

    .top-logo-text {
        width: 100%;
    }

    .top-logo-text h2 {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .top-logo-text p {
        font-size: 0.7rem;
        line-height: 1.3;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        right: 20px;
        transform: translateY(-50%);
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        padding: 16px;
        background: var(--navy);
        border-bottom: 3px solid var(--gold);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-admin-mobile {
        display: inline-flex !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 12px;
        margin-top: 8px;
    }

    .admin-link {
        display: none !important;
    }

    .page-header .emblem-lg {
        margin-top: 16px;
    }

    .container {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .radio-card {
        flex: 1 1 100%;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .tab-bar {
        flex-direction: column;
    }
}
