/* ==========================================================================
   GigVolt Universal Stylesheet
   Shared CSS variables, layout, typography, navigation, and footer components
   ========================================================================== */

:root {
  --bg: #090d16;
  --card-bg: #121a2b;
  --card-hover: #172136;
  --text: #f8fafc;
  --subtext: #94a3b8;
  --accent: #f97316;
  --accent-glow: rgba(249, 115, 22, 0.25);
  --border: #1e293b;
  --badge-bg: rgba(249, 115, 22, 0.12);
  --badge-border: rgba(249, 115, 22, 0.35);
  --btn-grad: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  --error-accent: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.25);
  --error-badge-bg: rgba(239, 68, 68, 0.12);
  --error-badge-border: rgba(239, 68, 68, 0.35);
  --error-btn-grad: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --card-hover: #f1f5f9;
    --text: #0f172a;
    --subtext: #475569;
    --accent: #ea580c;
    --accent-glow: rgba(234, 88, 12, 0.15);
    --border: #e2e8f0;
    --badge-bg: rgba(234, 88, 12, 0.1);
    --badge-border: rgba(234, 88, 12, 0.25);
    --btn-grad: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    --error-accent: #dc2626;
    --error-glow: rgba(220, 38, 38, 0.15);
    --error-badge-bg: rgba(220, 38, 38, 0.1);
    --error-badge-border: rgba(220, 38, 38, 0.25);
    --error-btn-grad: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

[id] {
  scroll-margin-top: 80px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Shared Top Navigation Bar
   ========================================================================== */
.top-nav {
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-nav-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.15rem;
}

.nav-brand .brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

.nav-brand .brand-text-logo {
  height: 24px;
  width: auto;
  max-width: 95px;
  object-fit: contain;
  display: block;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.back-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* ==========================================================================
   Shared Page Containers & Headers
   ========================================================================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px 80px 20px;
}

header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 14px;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.effective-date {
  color: var(--subtext);
  font-size: 0.95rem;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Shared Typography & Content Cards
   ========================================================================== */
.container h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0 0 8px 0;
  color: var(--accent);
}

.container h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.container p,
.container li {
  color: var(--text);
  font-size: 1rem;
}

.container ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.container li {
  margin-bottom: 8px;
}

.container a {
  color: var(--accent);
  text-decoration: underline;
}

.highlight-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
}

/* ==========================================================================
   Shared Action Buttons
   ========================================================================== */
.btn-primary {
  background: var(--btn-grad);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px var(--accent-glow);
  cursor: pointer;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
  text-decoration: none;
}

.btn-error {
  background: var(--error-btn-grad);
  box-shadow: 0 4px 14px var(--error-glow);
}

.btn-error:hover {
  box-shadow: 0 6px 20px var(--error-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text) !important;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

@media (prefers-color-scheme: light) {
  .btn-secondary {
    background: #f1f5f9;
  }

  .btn-secondary:hover {
    background: #e2e8f0;
  }
}

/* ==========================================================================
   Shared Error Card (404 / 500)
   ========================================================================== */
.error-page-wrap {
  min-height: calc(100vh - 65px - 75px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.error-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 36px;
  max-width: 580px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.error-code {
  font-size: 5.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #f97316 0%, #facc15 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -2px;
}

.error-code-500 {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.error-card h1 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.error-card p {
  color: var(--subtext);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ==========================================================================
   Shared Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  color: var(--subtext);
  font-size: 0.88rem;
  margin-top: auto;
}

.site-footer a {
  color: var(--subtext);
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.15s ease;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}