/* ProxyV4Viet commercial UI layer.
   This file only changes presentation and interaction states. API contracts,
   RBAC, capacity enforcement, payment and proxy runtime remain unchanged. */
:root {
  --pv-ink: #0b1730;
  --pv-muted: #61738a;
  --pv-soft: #f4f7fb;
  --pv-card: #ffffff;
  --pv-line: #dce6f1;
  --pv-blue: #2563eb;
  --pv-blue-dark: #1747b5;
  --pv-cyan: #19b8c5;
  --pv-teal: #0e9f93;
  --pv-navy: #07182e;
  --pv-shadow: 0 18px 48px rgba(18, 48, 86, .10);
  --pv-radius: 18px;
}

html { scroll-padding-top: 88px; }
body {
  color: var(--pv-ink);
  background: var(--pv-soft);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .42); outline-offset: 3px; }
button:disabled, .btn.is-disabled { cursor: not-allowed; opacity: .62; transform: none !important; box-shadow: none !important; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 14px; border-radius: 10px; color: #fff; background: var(--pv-navy); font-size: 12px; font-weight: 800; transition: top .2s ease; }
.skip-link:focus { top: 16px; }
.muted-line { line-height: 1.55; }

/* Shared navigation and controls */
.site-header, .app-nav, body > .nav { border-color: rgba(220, 230, 241, .88) !important; }
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(248, 250, 253, .88); backdrop-filter: blur(18px); }
.app-nav { position: sticky !important; top: 0; z-index: 30; backdrop-filter: blur(18px); }
.brand { letter-spacing: -.035em; }
.brand-mark { box-shadow: 0 8px 22px rgba(37, 99, 235, .22); }
.btn { min-height: 40px; border-radius: 11px !important; font-weight: 800 !important; letter-spacing: -.01em; }
.btn-primary { background: linear-gradient(135deg, var(--pv-blue), #367cf3) !important; box-shadow: 0 8px 18px rgba(37, 99, 235, .18); }
.btn-primary:hover { background: linear-gradient(135deg, var(--pv-blue-dark), var(--pv-blue)) !important; }
.btn-outline, .btn-ghost { border-color: var(--pv-line) !important; }
.btn-outline:hover, .btn-ghost:hover { border-color: #a8c0dc !important; background: #f6f9fd !important; }

/* Landing page */
.home-page { background: var(--pv-soft); }
.home-page .topbar { background: var(--pv-navy); }
.home-page .site-header { width: 100%; max-width: none; padding: 0 max(24px, calc((100% - 1160px) / 2)); }
.home-page .hero { min-height: 660px; padding-top: 100px; padding-bottom: 90px; }
.home-page .hero-copy { position: relative; z-index: 1; }
.home-page .hero h1 { max-width: 650px; color: var(--pv-ink); }
.home-page .hero h1 em, .home-page h2 em { color: var(--pv-blue); }
.home-page .hero-lead { max-width: 570px; color: var(--pv-muted); }
.hero-notes { border-top: 1px solid var(--pv-line); padding-top: 20px; }
.hero-notes b { color: var(--pv-ink); }
.home-page .hero-panel { filter: drop-shadow(0 25px 35px rgba(13, 48, 90, .12)); }
.home-page .console-card { border: 1px solid rgba(177, 207, 230, .92); box-shadow: var(--pv-shadow); }
.home-page .console-head { border-bottom-color: var(--pv-line); }
.home-page .live-status { border: 1px solid #b9eadf; background: #effbf7; color: #0b8b78; }
.home-page .feature-card, .home-page .price-card { border-color: var(--pv-line); border-radius: var(--pv-radius); box-shadow: 0 12px 30px rgba(18, 48, 86, .045); transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.home-page .feature-card:hover, .home-page .price-card:hover { transform: translateY(-4px); box-shadow: var(--pv-shadow); border-color: #bdd3e9; }
.home-page .feature-card.feature-main { background: linear-gradient(145deg, #e9fbfd, #f8fdff); }
.home-page .price-card.is-featured { box-shadow: 0 20px 48px rgba(37, 99, 235, .14); }
.home-page .price-card .portal-actions { min-height: 42px; }
.home-page .price-card .is-disabled { display: inline-flex; align-items: center; justify-content: center; width: 100%; text-align: center; }
.home-page .dark-band { position: relative; overflow: hidden; }
.home-page .dark-band::before { content: ''; position: absolute; width: 430px; height: 430px; right: -160px; top: -240px; border: 1px solid rgba(82, 201, 216, .16); border-radius: 50%; box-shadow: 0 0 0 55px rgba(82, 201, 216, .035), 0 0 0 110px rgba(82, 201, 216, .025); pointer-events: none; }
.home-page .workflow-item { transition: background .2s ease, padding-left .2s ease; }
.home-page .workflow-item:hover { padding-left: 8px; background: rgba(255, 255, 255, .025); }
.home-page .cta { border: 1px solid rgba(101, 220, 224, .2); box-shadow: 0 22px 50px rgba(7, 24, 46, .15); }
.home-page .footer { border-color: var(--pv-line); }

/* Auth and role-aware workspace */
.portal { padding-top: 42px !important; }
.portal-head { margin-bottom: 28px !important; }
.portal-head h1 { color: var(--pv-ink); }
.auth-card { box-shadow: 0 24px 70px rgba(18, 48, 86, .12) !important; border-color: #cbdceb !important; }
.auth-intro { background: radial-gradient(circle at 100% 0, rgba(32, 188, 199, .35), transparent 36%), linear-gradient(145deg, #07182e, #112f54 62%, #0b6f79) !important; }
.auth-form-column { background: rgba(255, 255, 255, .96) !important; }
.secure-chip { box-shadow: 0 5px 14px rgba(14, 159, 147, .10); }
.dashboard-shell { gap: 26px !important; }
.dashboard-sidebar { box-shadow: 0 12px 32px rgba(18, 48, 86, .07) !important; }
.side-nav button { transition: color .18s ease, background .18s ease, transform .18s ease; }
.side-nav button:hover { transform: translateX(2px); }
.dashboard-section.active { animation: pv-section-in .25s ease-out; }
.section-top { border-bottom: 1px solid transparent; }
.section-top h2 { color: var(--pv-ink); }
.metric-box { position: relative; overflow: hidden; box-shadow: 0 8px 20px rgba(18, 48, 86, .04); }
.metric-box::after { content: ''; position: absolute; right: -18px; top: -26px; width: 76px; height: 76px; border: 1px solid rgba(37, 99, 235, .13); border-radius: 50%; }
.metric-box strong { position: relative; z-index: 1; }
.portal-card, .plan-card, .proxy-card { box-shadow: 0 12px 32px rgba(18, 48, 86, .065) !important; }
.plan-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.plan-card:hover { transform: translateY(-2px); border-color: #b7d0e8 !important; box-shadow: 0 18px 38px rgba(18, 48, 86, .10) !important; }
.proxy-card { border-left: 4px solid var(--pv-blue) !important; }
.proxy-card .field-chip { background: linear-gradient(145deg, #f8fbfe, #f1f6fb); }
.endpoint-locked { background: #f7fafc; }
.table-wrap { box-shadow: 0 10px 28px rgba(18, 48, 86, .05); }
.admin-table th { letter-spacing: .04em; text-transform: uppercase; }
.result { border-left: 3px solid #85a5c9; }
.result.ok { border-left-color: var(--pv-teal); }
.result.error { border-left-color: #dc5b5b; }
.result.info { border-left-color: var(--pv-blue); }
.empty { background: linear-gradient(145deg, #fbfdff, #f4f8fc); }
.qr-box { align-items: stretch; }
.qr-box img { box-shadow: 0 14px 28px rgba(18, 48, 86, .12); }

/* Local operator dashboard keeps its existing security model while matching the product UI. */
.operator { padding-top: 50px !important; }
.operator-card { border-color: var(--pv-line) !important; box-shadow: var(--pv-shadow) !important; }
.operator-card h2 { letter-spacing: -.035em; }
.operator .status-value { color: var(--pv-ink); }

/* Dark mode */
body.dark-mode {
  --pv-ink: #e8f1fa;
  --pv-muted: #9db1c5;
  --pv-soft: #071525;
  --pv-card: #0f2136;
  --pv-line: #25405b;
  --pv-shadow: 0 18px 48px rgba(0, 0, 0, .26);
  background: var(--pv-soft);
}
body.dark-mode .site-header, body.dark-mode .app-nav, body.dark-mode body > .nav { background: rgba(7, 21, 37, .9) !important; border-color: var(--pv-line) !important; }
body.dark-mode .home-page .hero h1, body.dark-mode .home-page h2, body.dark-mode .portal-head h1, body.dark-mode .section-top h2 { color: var(--pv-ink); }
body.dark-mode .home-page .feature-card, body.dark-mode .home-page .price-card, body.dark-mode .home-page .console-card, body.dark-mode .portal-card, body.dark-mode .dashboard-sidebar, body.dark-mode .plan-card, body.dark-mode .proxy-card, body.dark-mode .operator-card { background: var(--pv-card) !important; border-color: var(--pv-line) !important; }
body.dark-mode .home-page .feature-card.feature-main { background: #10303b !important; }
body.dark-mode .home-page .console-stat, body.dark-mode .home-page .protocol-visual div { background: #122a42; border-color: var(--pv-line); }
body.dark-mode .home-page .protocol-visual, body.dark-mode .home-page .audit-visual { background: #10263d; }
body.dark-mode .auth-form-column { background: var(--pv-card) !important; }
body.dark-mode .fields input, body.dark-mode .fields select, body.dark-mode .metric-box, body.dark-mode .field-chip, body.dark-mode .empty, body.dark-mode .endpoint-locked { background: #122a42 !important; border-color: var(--pv-line) !important; color: var(--pv-ink); }
body.dark-mode .btn-outline, body.dark-mode .btn-ghost { background: #122a42 !important; color: var(--pv-ink) !important; border-color: var(--pv-line) !important; }
body.dark-mode .admin-table th { background: #122a42 !important; }

@keyframes pv-section-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .home-page .site-header { padding: 0 16px; }
  .home-page .hero { min-height: auto; padding-top: 66px; }
  .portal { padding-top: 28px !important; }
  .dashboard-shell { gap: 16px !important; }
  .dashboard-sidebar { box-shadow: none !important; }
}
@media (max-width: 480px) {
  .home-page .hero h1 { font-size: clamp(40px, 14vw, 56px); }
  .portal-head h1 { font-size: 36px !important; }
  .metric-grid { gap: 8px !important; }
  .metric-box { padding: 13px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
