/**
 * Community Safety Lab — THE VAULT Design System
 * Global Shared Styles for All Pages
 * This file provides consistent styling across the entire platform.
 * DO NOT modify JavaScript or functional logic.
 */

/* ==========================================================================
   1. CSS VARIABLES — Core Palette
   ========================================================================== */

:root {
  /* Core Palette */
  --vault-bg: #0B0F14;
  --vault-bg-gradient: radial-gradient(ellipse at top center, #131922 0%, #0B0F14 50%, #070A0D 100%);
  --vault-card: rgba(15, 20, 28, 0.95);
  --vault-card-border: rgba(47, 128, 237, 0.15);

  /* Accents */
  --steel-blue: #2F80ED;
  --steel-blue-dim: rgba(47, 128, 237, 0.6);
  --steel-blue-glow: rgba(47, 128, 237, 0.25);
  --muted-gold: #C9A24D;
  --muted-gold-dim: rgba(201, 162, 77, 0.7);

  /* Text */
  --text-primary: #E6E8EB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  /* Warning - Amber only, no red */
  --warning-amber: #F59E0B;
  --warning-amber-bg: rgba(245, 158, 11, 0.1);

  /* Borders & Surfaces */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --surface-elevated: rgba(20, 27, 38, 0.9);
}

/* ==========================================================================
   2. BASE STYLES
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--vault-bg);
  background-image: var(--vault-bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ==========================================================================
   3. HEADER — Institutional
   ========================================================================== */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(11, 15, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--steel-blue), #1a5bb8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 20px var(--steel-blue-glow);
}

header h1 {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

header .subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   4. TYPOGRAPHY
   ========================================================================== */

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 16px 0;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 24px 0 12px 0;
  color: var(--steel-blue);
  letter-spacing: -0.01em;
}

p, li {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

a {
  color: var(--steel-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #5BA0FF;
  text-decoration: underline;
}

ul, ol {
  padding-left: 20px;
  margin: 16px 0;
}

li {
  margin-bottom: 10px;
}

/* ==========================================================================
   5. CONTAINER & LAYOUT
   ========================================================================== */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px 60px;
}

.box {
  max-width: 900px;
  margin: 0 auto;
  background: var(--vault-card);
  padding: 32px;
  border-radius: 14px;
  border: 1px solid var(--vault-card-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   6. CARD STYLES
   ========================================================================== */

.card {
  background: var(--vault-card);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--vault-card-border);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.card-icon {
  font-size: 1.3rem;
}

.card h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 12px 0 24px 0;
}

/* ==========================================================================
   7. FORM ELEMENTS
   ========================================================================== */

label {
  display: block;
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

input, textarea, select {
  width: 100%;
  padding: 14px 16px;
  background: rgba(7, 10, 13, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--steel-blue);
  box-shadow: 0 0 0 3px var(--steel-blue-glow);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
  margin-right: 10px;
  accent-color: var(--steel-blue);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin-top: 20px;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.checkbox-label span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.field-hint {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   8. BUTTONS
   ========================================================================== */

button, .btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

button, .btn-primary {
  background: linear-gradient(135deg, var(--steel-blue), #1a5bb8);
  color: #fff;
  box-shadow: 0 4px 24px var(--steel-blue-glow), inset 0 1px 0 rgba(255,255,255,0.1);
}

button:hover, .btn-primary:hover {
  box-shadow: 0 6px 32px rgba(47, 128, 237, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--vault-card-border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.btn-secondary:hover {
  border-color: var(--steel-blue-dim);
  box-shadow: 0 4px 20px rgba(47, 128, 237, 0.15);
}

button[type="submit"], .submit-btn {
  margin-top: 24px;
  width: 100%;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   9. RESULT & OUTPUT AREAS
   ========================================================================== */

.result, #lookupResult, #output {
  margin-top: 20px;
  white-space: pre-line;
  padding: 16px;
  background: rgba(7, 10, 13, 0.6);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  min-height: 60px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

#lookupResult:empty {
  display: none;
}

/* ==========================================================================
   10. BADGES & STATUS
   ========================================================================== */

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(47, 128, 237, 0.15);
  color: var(--steel-blue);
}

.badge.success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.badge.warning {
  background: var(--warning-amber-bg);
  color: var(--warning-amber);
}

/* ==========================================================================
   11. PRIVACY DISCLAIMER BOX
   ========================================================================== */

.privacy-disclaimer {
  margin-top: 24px;
  padding: 16px;
  background: rgba(47, 128, 237, 0.06);
  border-radius: 10px;
  border: 1px solid var(--vault-card-border);
}

.privacy-disclaimer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.65;
}

.privacy-disclaimer strong {
  color: var(--steel-blue);
}

/* ==========================================================================
   12. HIGHLIGHT BOXES
   ========================================================================== */

.highlight-box {
  background: rgba(47, 128, 237, 0.1);
  border: 1px solid rgba(47, 128, 237, 0.3);
  border-radius: 10px;
  padding: 20px;
  margin: 24px 0;
}

.highlight-box p {
  margin: 0;
  color: var(--text-secondary);
}

.reassurance-box, .values-box, .community-note, .transparency-box {
  background: rgba(201, 162, 77, 0.08);
  border: 1px solid var(--muted-gold-dim);
  border-radius: 10px;
  padding: 20px;
  margin: 24px 0;
}

.reassurance-box p, .values-box p, .community-note p, .transparency-box p {
  margin: 0;
  color: var(--muted-gold);
}

.clarity-box {
  background: var(--warning-amber-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 20px;
  margin: 24px 0;
}

.clarity-box h3 {
  margin-top: 0;
  color: var(--warning-amber);
}

.clarity-box p, .clarity-box li {
  color: #fcd34d;
}

.helpful-box {
  background: rgba(47, 128, 237, 0.08);
  border: 1px solid rgba(47, 128, 237, 0.25);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
}

.helpful-box p {
  margin: 0;
  color: var(--text-secondary);
}

/* ==========================================================================
   13. ALERTS DISPLAY
   ========================================================================== */

.alert-row {
  display: flex;
  background: var(--vault-card);
  border: 1px solid var(--vault-card-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  transition: border-color 0.2s ease;
}

.alert-row:hover {
  border-color: var(--steel-blue-dim);
}

.alert-severity {
  width: 90px;
  text-align: center;
  font-weight: 600;
  padding: 8px;
  border-radius: 8px;
  margin-right: 16px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sev-info {
  background: rgba(47, 128, 237, 0.15);
  color: var(--steel-blue);
}

.sev-warning {
  background: var(--warning-amber-bg);
  color: var(--warning-amber);
}

.sev-critical {
  background: var(--warning-amber-bg);
  color: var(--warning-amber);
}

.alert-info {
  flex: 1;
}

.alert-info h4 {
  margin: 0 0 6px 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.alert-info p {
  margin: 0;
  font-size: 0.9rem;
}

.alert-info small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.empty {
  color: var(--text-muted);
  margin-top: 20px;
  font-style: italic;
}

/* ==========================================================================
   14. SUBSCRIBE SECTION
   ========================================================================== */

.subscribe-section {
  margin-top: 40px;
  padding: 24px;
  background: var(--vault-card);
  border: 1px solid var(--vault-card-border);
  border-radius: 14px;
}

.subscribe-section h3 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  color: var(--steel-blue);
}

.subscribe-section p {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   15. SUPPORT SECTION
   ========================================================================== */

.support-section {
  max-width: 600px;
  margin: 40px auto;
  padding: 0 32px;
}

.support-card {
  background: var(--vault-card);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.support-card h3 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.support-card p {
  margin: 0 0 20px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.support-btn {
  display: inline-block;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--muted-gold), #a8873d);
  color: #0B0F14;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: box-shadow 0.2s ease;
}

.support-btn:hover {
  box-shadow: 0 4px 20px rgba(201, 162, 77, 0.3);
  text-decoration: none;
}

.support-note {
  margin: 16px 0 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Inline support boxes */
.support-inline {
  margin: 32px 0;
  padding: 24px;
  background: rgba(47, 128, 237, 0.06);
  border: 1px solid var(--vault-card-border);
  border-radius: 12px;
  text-align: center;
}

.support-inline h3 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.support-inline p {
  margin: 0 0 16px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.support-inline .support-btn {
  margin-bottom: 0;
}

.support-inline .support-note {
  margin-top: 12px;
}

/* ==========================================================================
   16. DONATE SECTION
   ========================================================================== */

.donate-section {
  background: rgba(47, 128, 237, 0.08);
  border: 1px solid var(--vault-card-border);
  border-radius: 12px;
  padding: 28px;
  margin: 32px 0;
  text-align: center;
}

.donate-section p {
  margin: 0 0 16px 0;
}

.donate-button {
  display: inline-block;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--muted-gold), #a8873d);
  color: #0B0F14;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: box-shadow 0.2s ease;
}

.donate-button:hover {
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(201, 162, 77, 0.3);
}

/* ==========================================================================
   17. ACCORDION (FAQ)
   ========================================================================== */

.accordion {
  margin-top: 24px;
}

.accordion-item {
  border: 1px solid var(--vault-card-border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--vault-card);
}

.accordion-header {
  background: rgba(15, 20, 28, 0.6);
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.accordion-header:hover {
  background: rgba(30, 41, 59, 0.6);
}

.accordion-header:focus {
  outline: 2px solid var(--steel-blue);
  outline-offset: -2px;
}

.accordion-question {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  padding-right: 16px;
}

.accordion-icon {
  font-size: 1rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(7, 10, 13, 0.5);
}

.accordion-item.active .accordion-content {
  max-height: 500px;
}

.accordion-answer {
  padding: 20px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.accordion-answer p {
  margin: 0 0 12px 0;
}

.accordion-answer p:last-child {
  margin-bottom: 0;
}

.accordion-answer ul {
  margin: 12px 0;
  padding-left: 20px;
}

.accordion-answer li {
  margin-bottom: 8px;
}

/* ==========================================================================
   18. TABLES (Admin)
   ========================================================================== */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th, td {
  border: 1px solid var(--vault-card-border);
  padding: 12px 14px;
  text-align: left;
}

th {
  background: rgba(15, 20, 28, 0.8);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  background: var(--vault-card);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

tr:hover td {
  background: rgba(20, 27, 38, 0.9);
}

/* ==========================================================================
   19. MODAL (Admin)
   ========================================================================== */

#alertModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

.modal-inner {
  background: var(--vault-card);
  max-width: 500px;
  margin: 60px auto;
  padding: 28px;
  border-radius: 14px;
  border: 1px solid var(--vault-card-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-inner h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

/* ==========================================================================
   20. TOAST NOTIFICATIONS (Admin)
   ========================================================================== */

#adminToast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 10px;
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
  z-index: 99999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

#adminToast.show {
  opacity: 1;
  transform: translateY(0);
}

#adminToast.success {
  background: linear-gradient(135deg, #059669, #047857);
  border-left: 4px solid #10b981;
}

#adminToast.error {
  background: linear-gradient(135deg, var(--warning-amber), #d97706);
  border-left: 4px solid var(--warning-amber);
}

/* ==========================================================================
   21. LOGIN BOX
   ========================================================================== */

.login-box {
  background: var(--vault-card);
  padding: 36px;
  border-radius: 14px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--vault-card-border);
}

.login-box h2 {
  text-align: center;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.login-box input {
  margin-bottom: 16px;
}

.login-box button {
  width: 100%;
  margin-top: 8px;
}

.login-box button.secondary {
  background: var(--surface-elevated);
  border: 1px solid var(--vault-card-border);
}

.login-box button.secondary:hover {
  border-color: var(--steel-blue-dim);
}

.login-box .error {
  color: var(--warning-amber);
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
}

/* ==========================================================================
   22. FOOTER — Institutional
   ========================================================================== */

footer, .csl-footer {
  margin-top: 60px;
  padding: 40px 32px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(7, 10, 13, 0.6);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 32px;
}

.footer-column h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 16px 0;
}

.footer-column a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 0;
  transition: color 0.15s ease;
}

.footer-column a:hover {
  color: var(--steel-blue);
  text-decoration: none;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-statement {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0 0 12px 0;
  line-height: 1.6;
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

.footer-translation-notice {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 16px 0 0 0;
  line-height: 1.5;
}

/* Legacy footer support */
.csl-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 900px;
  margin: 60px auto 0;
  padding: 24px 32px;
  border-top: 1px solid var(--border-subtle);
  background: transparent;
}

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

.csl-footer a:hover {
  color: var(--steel-blue);
  text-decoration: none;
}

/* ==========================================================================
   23. FORM NOTES & DISCLAIMERS
   ========================================================================== */

.form-note, .report-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* ==========================================================================
   24. SUBTITLE
   ========================================================================== */

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ==========================================================================
   25. PAGE TITLE STYLING
   ========================================================================== */

.page-title {
  margin: 0 0 8px 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ==========================================================================
   26. MICRO-INTERACTIONS
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .card {
    transition: border-color 0.2s ease, box-shadow 0.25s ease;
  }

  .card:hover {
    border-color: rgba(47, 128, 237, 0.25);
  }

  a {
    transition: color 0.15s ease;
  }
}

/* ==========================================================================
   27. LIGHT MODE FALLBACK
   ========================================================================== */

@media (prefers-color-scheme: light) {
  :root {
    --vault-bg: #F4F6F8;
    --vault-bg-gradient: radial-gradient(ellipse at top center, #FFFFFF 0%, #F4F6F8 50%, #E8EBEF 100%);
    --vault-card: rgba(255, 255, 255, 0.98);
    --vault-card-border: rgba(47, 128, 237, 0.2);

    --text-primary: #1A1F26;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;

    --border-subtle: rgba(0, 0, 0, 0.08);
    --surface-elevated: rgba(255, 255, 255, 0.95);
  }

  body {
    background: var(--vault-bg);
    background-image: var(--vault-bg-gradient);
  }

  header {
    background: rgba(255, 255, 255, 0.9);
  }

  input, textarea, select {
    background: rgba(244, 246, 248, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
  }

  input:focus, textarea:focus, select:focus {
    background: #fff;
  }

  .result, #lookupResult, #output {
    background: rgba(244, 246, 248, 0.8);
  }

  footer, .csl-footer {
    background: rgba(244, 246, 248, 0.8);
  }

  .btn-secondary, .login-box button.secondary {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
  }
}

/* ==========================================================================
   28. HIGH CONTRAST MODE
   ========================================================================== */

@media (prefers-contrast: high) {
  :root {
    --vault-card-border: rgba(47, 128, 237, 0.5);
    --border-subtle: rgba(255, 255, 255, 0.2);
  }

  .card, .box {
    border-width: 2px;
  }

  button, .btn-primary, .btn-secondary {
    border: 2px solid currentColor;
  }

  input, textarea, select {
    border-width: 2px;
  }
}

/* ==========================================================================
   29. PRINT STYLES
   ========================================================================== */

@media print {
  body {
    background: white !important;
    color: black !important;
  }

  header, footer, .csl-footer {
    background: white !important;
  }

  .card, .box {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }

  a {
    text-decoration: underline;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* ==========================================================================
   30. FOCUS VISIBLE STATES
   ========================================================================== */

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.accordion-header:focus-visible {
  outline: 2px solid var(--steel-blue);
  outline-offset: 2px;
}

/* ==========================================================================
   31. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
