:root {
  --bg: #0b1220;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: #111827;
  --card: #ffffff;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --heading: #f8fafc;
  --line: rgba(148, 163, 184, 0.12);
  --primary: #ef4444;
  --primary-dark: #dc2626;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 20px 50px rgba(2, 6, 23, 0.35);
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1200px;
}

* { box-sizing: border-box; }
html { 
  scroll-behavior: smooth; 
  min-height: 100%; 
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(239, 68, 68, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 25%),
    linear-gradient(180deg, #0b1220 0%, #111827 100%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(11, 18, 32, 0.72);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-copy strong {
  display: block;
  font-size: 0.95rem;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.brand-copy span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a:not(.btn) {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: 0.2s ease;
}

.nav-links a:not(.btn):hover {
  color: var(--heading);
  background: rgba(255, 255, 255, 0.06);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--heading);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-approve {
  background: var(--success);
  color: white;
}

.btn-full { width: 100%; }

/* --- Layout Sections --- */
.page-shell {
  padding: 48px 0;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 24px;
}

.hero {
  padding: 48px 0 24px;
  position: relative;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--heading);
}

.hero-copy p {
  margin: 0 0 24px;
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 60ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fde68a;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
}

.stat {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat strong {
  display: block;
  color: var(--heading);
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.stat span {
  color: var(--muted);
  font-size: 0.85rem;
}

/* --- Cards & Grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}

.gallery-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0f172a;
  position: relative;
}

.gallery-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(15, 23, 42, 0.4) 100%);
  pointer-events: none;
}

.gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-content {
  padding: 20px;
}

.gallery-content h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.gallery-content p {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 0.9rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 500;
}

/* --- Vehicle Plates --- */
.plate-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fef08a, #facc15);
  border: 3px solid #1e293b;
  border-radius: 10px;
  padding: 6px 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #0f172a;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1), inset 0 -2px 0 rgba(0,0,0,0.1);
  font-family: monospace;
  text-transform: uppercase;
}

.plate-chip.large {
  padding: 12px 20px;
  font-size: 1.4rem;
  border-radius: 14px;
}

/* --- Form Elements --- */
.form-intro { margin-bottom: 24px; }
.form-intro h2 { margin: 0; font-size: 1.8rem; color: var(--heading); }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field span { font-weight: 600; font-size: 0.9rem; color: var(--text); }

input, select, textarea {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: white;
  font-size: 1rem;
  width: 100%;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.6);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.notice {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 600;
}

.notice-success { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.notice-error { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }

.field-error {
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 4px 0 8px;
}

.step-error input:not([readonly]), 
.step-error select, 
.step-error textarea,
.input-error {
  border-color: var(--primary) !important;
  background: rgba(239, 68, 68, 0.08) !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

/* --- Special Components --- */
.category-chart { display: grid; gap: 20px; }
.chart-row { display: flex; flex-direction: column; gap: 8px; }
.chart-label { font-size: 0.9rem; font-weight: 700; color: var(--heading); }
.chart-bar-container { display: flex; align-items: center; gap: 12px; }
.chart-bar-wrap { background: rgba(255,255,255,0.05); height: 10px; border-radius: 5px; overflow: hidden; flex-grow: 1; }
.chart-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.chart-count { font-size: 0.85rem; font-weight: 800; color: var(--muted); min-width: 24px; text-align: right; }

.dvla-snapshot {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 24px;
  border-radius: var(--radius);
}

.lookup-plate-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.lookup-caption {
  margin: 0;
  font-weight: 600;
  color: var(--success);
  font-size: 0.9rem;
}

.lookup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.lookup-grid article {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.lookup-grid article span {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.lookup-grid article strong {
  font-size: 0.95rem;
  color: var(--heading);
}

.lookup-empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-ok { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.status-danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

.footer-inner {
  padding: 32px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Admin Specific --- */
.theme-admin .panel { background: #0f172a; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 12px; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-panel { display: block; width: 100%; }
}

@media (max-width: 600px) {
  .nav { 
    flex-direction: column; 
    align-items: center; 
    text-align: center;
    gap: 16px;
  }
  .nav-links {
    justify-content: center;
    width: 100%;
  }
  .nav-links a {
    flex: 1 1 auto;
    text-align: center;
  }
  .hero-stats { grid-template-columns: 1fr; }
  .stat { text-align: center; }
}

/* --- Animations --- */
.flash-input {
  animation: flash-input 1.5s ease;
}

@keyframes flash-input {
  0% { background-color: rgba(245, 158, 11, 0.4); border-color: var(--accent); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.2); }
  100% { background-color: rgba(15, 23, 42, 0.4); border-color: rgba(255, 255, 255, 0.1); box-shadow: none; }
}

/* --- Promoted Feature --- */
.promoted-wrapper {
  position: relative;
  padding: 6px;
  background: linear-gradient(135deg, #b45309, #f59e0b, #fff7ed, #f59e0b, #b45309);
  background-size: 200% 200%;
  animation: promoted-border-flow 4s linear infinite;
  border-radius: calc(var(--radius) + 6px);
  box-shadow: 0 20px 40px -10px rgba(180, 83, 9, 0.3);
  overflow: hidden;
}

@keyframes promoted-border-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.promoted-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #000;
  color: #fbbf24;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  z-index: 10;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 1px solid #fbbf24;
}

.promoted-canvas-area {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Ensure card content sits above the canvas */
.promoted-wrapper .card {
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, rgba(253, 230, 138, 0.95), rgba(245, 158, 11, 0.95));
  border: none;
  animation: promoted-card-pulse 4s infinite alternate;
}

@keyframes promoted-card-pulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.1) contrast(1.05); }
}

.promoted-wrapper .gallery-content {
  background: rgba(255, 255, 255, 0.4);
}

/* Specialized image area for promoted */
.promoted-wrapper .gallery-image {
  position: relative;
  background: transparent !important;
  overflow: hidden;
}

.promoted-wrapper .gallery-image img {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid #fde68a;
}

/* Background gradient for the image area where canvas lives */
.promoted-wrapper .promoted-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 50%, #b45309 100%);
  z-index: 1;
}

/* --- Promoted Detail Page --- */
.promoted-detail-bg {
  background: 
    radial-gradient(circle at 20% 20%, rgba(251, 191, 36, 0.15), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(180, 83, 9, 0.2), transparent 40%),
    linear-gradient(180deg, #0b1220 0%, #1a140a 100%) !important;
  position: relative;
  animation: gold-shimmer 8s infinite alternate;
}

@keyframes gold-shimmer {
  0% { filter: contrast(1) brightness(1); }
  100% { filter: contrast(1.1) brightness(1.15); }
}


.promoted-glow-text {
  color: #fbbf24 !important;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.8), 0 0 40px rgba(245, 158, 11, 0.4);
  letter-spacing: -0.02em;
}

.premium-badge-glow {
  animation: premium-badge-glow 2s infinite ease-in-out;
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: #fbbf24 !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

@keyframes premium-badge-glow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(245, 158, 11, 0.7); }
}

.promoted-detail-bg .site-header,
.promoted-detail-bg .page-shell,
.promoted-detail-bg .site-footer {
  position: relative;
  z-index: 1;
}

.promoted-detail-bg .panel {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(251, 191, 36, 0.1);
}

/* --- Cookie Consent Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.cookie-banner p {
  margin: 0;
  max-width: 600px;
}

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

.cookie-banner .btn {
  white-space: nowrap;
  font-size: 0.8rem;
  padding: 8px 20px;
}

@media (max-width: 600px) {
  .cookie-banner {
    flex-direction: column;
    text-align: center;
    padding: 16px;
  }
}
