/* ============================================================================
   GDTG ENTERPRISE CLIENT UNIFIED LAYER
   Loaded LAST in _Layout.cshtml (after tokens, layout-shell, components, responsive).
   1. Enforces enterprise typography (Plus Jakarta Sans / Inter - removes Orbitron).
   2. Normalizes ALL legacy dark Tailwind/inline subpages into Light-SaaS / Dark-SaaS.
   3. Provides standardized Enterprise Lucide Icon Badges (.gdtg-ico-badge).
   ============================================================================ */

/* 1. Unified Corporate Typography (neutralizes sci-fi Orbitron/Rajdhani inline & CSS styles) */
body,
main,
main h1,
main h2,
main h3,
main h4,
main .page-title,
main .stat-value,
main .order-title,
main .listings-title,
main .voucher-name,
main .discount-amount,
main .empty-title,
[style*="Orbitron"],
[style*="Rajdhani"] {
    font-family: var(--font-display, 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif) !important;
}

main h1,
main h2 {
    letter-spacing: -0.02em;
}

/* 2. Standardized Enterprise Icon System (Lucide Vector SVGs) */
.gdtg-ico-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--gdtg-border, #e2e8f0);
    background: var(--gdtg-surface-alt, #f1f5f9);
    color: var(--gdtg-primary-strong, #0891b2);
}

.gdtg-ico-badge.ico-blue { background: rgba(37, 99, 235, 0.1); border-color: rgba(37, 99, 235, 0.22); color: #2563eb; }
.gdtg-ico-badge.ico-cyan { background: rgba(6, 182, 212, 0.1); border-color: rgba(6, 182, 212, 0.25); color: #0891b2; }
.gdtg-ico-badge.ico-emerald { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.25); color: #059669; }
.gdtg-ico-badge.ico-amber { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.28); color: #d97706; }
.gdtg-ico-badge.ico-rose { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.25); color: #e11d48; }

.gdtg-ico-badge svg,
[data-lucide] {
    stroke-width: 1.9;
}

.gdtg-label-ico {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.gdtg-label-ico svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 3. Light-Theme Full Subpage Normalization (overrides legacy bg-slate-800/900 & dark hex) */
body.light-theme {
    background: var(--gdtg-bg, #f8fafc) !important;
    background-image: none !important;
    color: var(--gdtg-text, #0f172a) !important;
}

body.light-theme::before,
body.light-theme::after {
    display: none !important;
}

body.light-theme main[role="main"] {
    background: var(--gdtg-bg, #f8fafc);
    color: var(--gdtg-text, #0f172a);
}

body.light-theme main .deposit-container,
body.light-theme main .scam-detail-page,
body.light-theme main .policy-page,
body.light-theme main .orders-container,
body.light-theme main .voucher-container,
body.light-theme main > section[style*="#0f172a"],
body.light-theme main > section[style*="#1e293b"],
body.light-theme main > div[style*="#0f172a"],
body.light-theme main > div[style*="#1e293b"] {
    background: var(--gdtg-bg-hero, #f8fafc) !important;
    color: var(--gdtg-text, #0f172a) !important;
}

body.light-theme main section > div[style*="filter: blur"],
body.light-theme main section > div[style*="rgba(15, 23, 42"],
body.light-theme main section > .absolute.inset-0 > div[class*="from-slate-900"] {
    display: none !important;
}

/* Cards & Panels in Light Mode */
body.light-theme main .deposit-card,
body.light-theme main .scam-card,
body.light-theme main .account-card,
body.light-theme main .shop-detail-card,
body.light-theme main .stat-box,
body.light-theme main .voucher-card,
body.light-theme main .order-card,
body.light-theme main .info-card,
body.light-theme main .detail-card,
body.light-theme main .qr-modal-content,
body.light-theme main .privacy-request-box,
body.light-theme main .bg-slate-800,
body.light-theme main .bg-slate-800\/60,
body.light-theme main .bg-slate-800\/75,
body.light-theme main .bg-slate-800\/80,
body.light-theme main .bg-slate-900\/50,
body.light-theme main .from-slate-800 {
    background: #ffffff !important;
    background-image: none !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.08) !important;
}

body.light-theme main .deposit-header,
body.light-theme main .qr-modal-header {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%) !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme main .deposit-title,
body.light-theme main .qr-modal-title,
body.light-theme main .section-title,
body.light-theme main .info-value {
    color: #0f172a !important;
}

body.light-theme main .deposit-subtitle,
body.light-theme main .amount-label,
body.light-theme main .info-label {
    color: #475569 !important;
}

body.light-theme main .amount-btn {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}

body.light-theme main .amount-btn:hover,
body.light-theme main .amount-btn.selected {
    background: #eff6ff !important;
    border-color: #2563eb !important;
    color: #1d4ed8 !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14) !important;
}

body.light-theme main .amount-display {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
}

body.light-theme main .amount-value {
    color: #1d4ed8 !important;
}

body.light-theme main .card-banner {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
}

body.light-theme main .card-banner-text h4 {
    color: #1e40af !important;
}

/* Text contrast inside Light subpages (preserving white on solid colored buttons/cards) */
body.light-theme main .text-white:not(.bg-gradient-to-r):not(.bg-red-500):not(.bg-red-600):not(.bg-blue-500):not(.bg-blue-600):not(.bg-cyan-500):not(.bg-emerald-500):not(.bg-amber-500):not(.gdtg-btn-primary):not(.generate-btn):not(.card-banner-btn):not(.step-circle),
body.light-theme main h1.text-white,
body.light-theme main h2.text-white,
body.light-theme main h3.text-white {
    color: #0f172a !important;
}

body.light-theme main .text-slate-300,
body.light-theme main .text-gray-300,
body.light-theme main .text-slate-200 {
    color: #334155 !important;
}

body.light-theme main .text-slate-400,
body.light-theme main .text-gray-400,
body.light-theme main .text-slate-500 {
    color: #64748b !important;
}

body.light-theme main .text-cyan-400,
body.light-theme main .text-cyan-300,
body.light-theme main .text-blue-400 {
    color: #0284c7 !important;
}

body.light-theme main .text-yellow-400 {
    color: #b45309 !important;
}

body.light-theme main .text-amber-300 {
    color: #92400e !important;
}

/* Preserve white text on intentional dark hero cards / gradient buttons / step badges */
body.light-theme .gdtg-service-card,
body.light-theme .gdtg-service-card *,
body.light-theme .gdtg-guide-dark-panel,
body.light-theme .gdtg-guide-dark-panel h3,
body.light-theme .step-circle,
body.light-theme a.bg-gradient-to-r,
body.light-theme button.bg-gradient-to-r,
body.light-theme .bg-gradient-to-r.text-white {
    color: #ffffff !important;
}

body.light-theme .step-label {
    color: #334155 !important;
    font-weight: 600;
}

/* Form inputs/selects inside Light subpages */
body.light-theme main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]).bg-slate-900,
body.light-theme main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]).bg-slate-800,
body.light-theme main textarea.bg-slate-900,
body.light-theme main textarea.bg-slate-800,
body.light-theme main select.bg-slate-900,
body.light-theme main select.bg-slate-800,
body.light-theme main .custom-input {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme main input:focus,
body.light-theme main textarea:focus,
body.light-theme main select:focus {
    background: #ffffff !important;
    border-color: #06b6d4 !important;
}

/* Button contrast inside Light Mode subpages */
body.light-theme main a.bg-slate-700,
body.light-theme main a.bg-slate-700\/50,
body.light-theme main button.bg-slate-700,
body.light-theme main a.bg-gray-700 {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}

body.light-theme main a.bg-slate-700:hover,
body.light-theme main a.bg-slate-700\/50:hover,
body.light-theme main button.bg-slate-700:hover,
body.light-theme main a.bg-gray-700:hover {
    background: #f1f5f9 !important;
    border-color: #0891b2 !important;
    color: #0f172a !important;
}

/* Additional Light Mode normalizations for secondary containers */
body.light-theme main .bg-slate-900\/80,
body.light-theme main .bg-slate-900\/90,
body.light-theme main .bg-slate-800\/90,
body.light-theme main .bg-slate-800\/50,
body.light-theme main .bg-slate-800\/30 {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-theme main .bg-slate-900\/50 {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme main .text-slate-100 {
    color: #0f172a !important;
}

body.light-theme main .border-slate-700,
body.light-theme main .border-slate-700\/50,
body.light-theme main .border-gray-700 {
    border-color: #e2e8f0 !important;
}

/* ============================================================================
   4. MyOrders, UserVoucher & QuyBaoHiem Light Mode Enterprise Normalization
   ============================================================================ */
body.light-theme main .stat-card,
body.light-theme main .filter-section,
body.light-theme main .listings-section,
body.light-theme main .tabs-container,
body.light-theme main .tabs-wrapper,
body.light-theme main .view-toggle,
body.light-theme main .empty-state,
body.light-theme main .member-card {
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.08) !important;
}

body.light-theme main .stat-label,
body.light-theme main .filter-label,
body.light-theme main .page-subtitle,
body.light-theme main .empty-message,
body.light-theme main .listings-count {
    color: #475569 !important;
}

body.light-theme main .stat-value,
body.light-theme main .listings-title,
body.light-theme main .empty-title,
body.light-theme main .order-title,
body.light-theme main .voucher-name {
    color: #0f172a !important;
    text-shadow: none !important;
}

body.light-theme main .voucher-container .page-title {
    color: #0f172a !important;
    text-shadow: none !important;
}

body.light-theme main .filter-input,
body.light-theme main .filter-select,
body.light-theme main .search-box input {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme main .filter-select option {
    background: #ffffff !important;
    color: #0f172a !important;
}

body.light-theme main .tab-button,
body.light-theme main .tab-btn,
body.light-theme main .view-btn {
    color: #475569 !important;
}

body.light-theme main .tab-button:hover,
body.light-theme main .tab-btn:hover,
body.light-theme main .view-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-theme main .tab-button.active,
body.light-theme main .tab-btn.active,
body.light-theme main .view-btn.active {
    background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

body.light-theme main .tab-button.active .tab-badge,
body.light-theme main .tab-btn.active .tab-count {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

body.light-theme main .tab-badge,
body.light-theme main .tab-count {
    background: #f1f5f9 !important;
    color: #334155 !important;
}

body.light-theme main .voucher-discount {
    background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%) !important;
    border: 1px solid #c7d2fe !important;
}

body.light-theme main .discount-amount {
    color: #4f46e5 !important;
    text-shadow: none !important;
}

body.light-theme main .discount-type {
    color: #475569 !important;
}

body.light-theme main .voucher-info .info-row {
    border-bottom-color: #e2e8f0 !important;
}

body.light-theme main .order-account-info,
body.light-theme main .order-account-info .order-info-value {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-theme main .order-account-info h4 {
    color: #0f172a !important;
}

body.light-theme main .btn-secondary {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

/* QuyBaoHiem Light Mode tokens & header contrast */
body.light-theme main .insurance-page {
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --glass-bg: #ffffff;
    --glass-border: #e2e8f0;
    background: var(--gdtg-bg, #f8fafc) !important;
}

body.light-theme main .insurance-page .page-header {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 12px 0 8px !important;
}

body.light-theme main .insurance-page .bg-effects,
body.light-theme main .insurance-page .particles-container {
    opacity: 0.14 !important;
}

body.light-theme main .insurance-page .page-title {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 60%, #0891b2 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

body.light-theme main .insurance-page .page-subtitle {
    color: #475569 !important;
}

body.light-theme main .insurance-page .page-badge {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1d4ed8 !important;
}

/* ============================================================================
   5. Enterprise Policy & Legal Document Pages (Light + Dark unified)
   ============================================================================ */
.policy-shell {
    min-height: 75vh;
    padding: 36px 16px 56px;
    background: transparent;
}

.policy-shell-inner {
    max-width: 1020px;
    margin: 0 auto;
}

.policy-hero-head {
    text-align: center;
    margin-bottom: 24px;
}

.policy-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: 9999px;
    background: rgba(37, 99, 235, 0.09);
    border: 1px solid rgba(37, 99, 235, 0.24);
    color: var(--gdtg-primary-strong);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.policy-hero-title {
    font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: clamp(1.65rem, 3vw, 2.3rem);
    font-weight: 800;
    color: var(--gdtg-text);
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.policy-hero-sub {
    font-size: 14px;
    color: var(--gdtg-muted);
    margin: 0;
}

.policy-doc-card {
    background: var(--gdtg-card);
    border: 1px solid var(--gdtg-border);
    border-radius: 20px;
    padding: 34px 38px;
    box-shadow: var(--gdtg-shadow-md);
}

.policy-doc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--gdtg-border);
    font-size: 12.5px;
    color: var(--gdtg-muted);
}

.policy-doc-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #059669;
    font-weight: 700;
}

body.dark-theme .policy-doc-meta-pill {
    color: #34d399;
}

.policy-prose {
    color: var(--gdtg-text-secondary);
    font-size: 15.5px;
    line-height: 1.78;
}

.policy-prose h2 {
    font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 18.5px;
    font-weight: 800;
    color: var(--gdtg-text);
    margin: 26px 0 10px 0;
    padding: 8px 0 8px 14px;
    border-left: 3.5px solid var(--gdtg-primary);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.06) 0%, transparent 100%);
    border-radius: 0 8px 8px 0;
}

.policy-prose p {
    margin: 0 0 14px 0;
}

.policy-prose ul,
.policy-prose ol {
    margin: 0 0 16px 22px;
    padding: 0;
}

.policy-prose ul {
    list-style: disc;
}

.policy-prose ol {
    list-style: decimal;
}

.policy-prose li {
    margin-bottom: 8px;
}

.policy-prose strong {
    color: var(--gdtg-text);
    font-weight: 700;
}

.policy-prose code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--gdtg-surface-alt);
    border: 1px solid var(--gdtg-border);
    color: var(--gdtg-primary-strong);
}

.policy-callout {
    padding: 15px 18px;
    border-radius: 13px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.22);
    color: var(--gdtg-text-secondary);
    font-size: 14.5px;
    line-height: 1.65;
    margin-bottom: 22px;
}

@media (max-width: 768px) {
    .policy-doc-card {
        padding: 22px 18px;
        border-radius: 16px;
    }

    .policy-prose h2 {
        font-size: 16.5px;
    }
}
