/* ===== Global dark pumpkin overrides ===== */
:root,
[data-theme="dark"] {
  /* Dark brown palette (Pico pumpkin dark shades) */
  --pico-background-color: #271805;
  --pico-card-background-color: #372004;
  --pico-card-sectioning-background-color: #181b24;
  --pico-color: #e8eaf0;
  --pico-h1-color: #fff;
  --pico-h2-color: #f0f1f3;
  --pico-h3-color: #e0e3e7;
  --pico-form-element-background-color: #482802;
  --pico-form-element-color: #e8eaf0;
  --pico-form-element-border-color: #593100;
  --pico-form-element-placeholder-color: #6b7280;
  --pico-muted-color: #7b8495;
  --pico-muted-border-color: #1e2130;
  --pico-table-border-color: #1e2130;
  --pico-table-row-stripped-background-color: rgba(255, 149, 0, 0.04);
}

body {
  background-color: #271805; /* Pico pumpkin-900, dark brown */
  min-height: 100vh;
}

/* ===== Layout helpers ===== */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== Navigation ===== */
nav.site-nav {
  background: #13151c;
  border-bottom: 1px solid #2e3347;
  padding: 0.75rem 1rem;
}

nav.site-nav .nav-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav.site-nav .site-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--pico-primary);
  text-decoration: none;
  margin-right: auto;
}

nav.site-nav a {
  color: var(--pico-color);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

nav.site-nav a:hover,
nav.site-nav a.active {
  color: var(--pico-primary);
  border-bottom-color: var(--pico-primary);
}

/* ===== Page header ===== */
.page-header {
  padding: 2rem 0 1rem;
}

.page-header h1 {
  margin-bottom: 0;
}

/* ===== Cards ===== */
article {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ===== Tables ===== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 400px;
}

table td,
table th {
  white-space: nowrap;
}

table .actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

table .actions button {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  margin: 0;
}

/* ===== Buttons ===== */
button,
[type="submit"],
[role="button"] {
  cursor: pointer;
}

.btn-sm {
  padding: 0.35rem 0.75rem !important;
  font-size: 0.8rem !important;
}

.btn-danger {
  --pico-background-color: #7f1d1d;
  --pico-border-color: #7f1d1d;
  background: #7f1d1d;
  border-color: #991b1b;
  color: #fff;
}

.btn-danger:hover {
  background: #991b1b;
  border-color: #b91c1c;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #13151c;
  border: 1px solid #2e3347;
  border-radius: 0.75rem;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-box h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--pico-muted-color);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-top: -0.25rem;
}

.modal-close:hover {
  color: var(--pico-color);
}

.modal-error {
  color: #f87171;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: none;
}

.modal-error.visible {
  display: block;
}

/* ===== Flash messages ===== */
.flash {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.flash-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.flash-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.flash-info {
  background: rgba(228, 133, 0, 0.12);
  border: 1px solid rgba(228, 133, 0, 0.35);
  color: #fbbf24;
}

/* ===== Front page verification ===== */
.verify-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.verify-card {
  background: #372004; /* Pico pumpkin-850 */
  border: 1px solid #482802; /* Pico pumpkin-800 */
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 440px;
}

.verify-logo {
  display: block;
  width: 60%;
  max-width: 220px;
  height: auto;
  margin: 0 auto 1.5rem;
}

.verify-card h1 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.verify-card .subtitle {
  text-align: center;
  color: var(--pico-muted-color);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.verify-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.verify-fields label {
  margin-bottom: 0;
}

/* ===== Result overlay animation ===== */
.result-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
}

.result-overlay.show {
  display: flex;
  animation: fadeInBg 0.3s ease-out;
}

.result-bubble {
  text-align: center;
  padding: 3rem 2.5rem;
  border-radius: 1.25rem;
  max-width: 360px;
  width: 90%;
  animation: popOut 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-bubble.genuine {
  background: linear-gradient(135deg, #052e16, #064e3b);
  border: 2px solid #10b981;
}

.result-bubble.not-found {
  background: linear-gradient(135deg, #2d0a0a, #450a0a);
  border: 2px solid #ef4444;
}

.result-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 1rem;
  display: block;
}

.result-bubble h2 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
}

.result-bubble.genuine h2 {
  color: #6ee7b7;
}

.result-bubble.not-found h2 {
  color: #fca5a5;
}

.result-bubble p {
  color: #9ca3af;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.result-bubble button {
  width: 100%;
}

@keyframes fadeInBg {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes popOut {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== Import results ===== */
.import-result {
  margin-top: 1.5rem;
}

.omitted-list {
  max-height: 300px;
  overflow-y: auto;
  background: #0d0e12;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.375rem;
  padding: 0.75rem;
  font-size: 0.85rem;
  font-family: monospace;
  color: var(--pico-muted-color);
}

.omitted-list p {
  margin: 0.2rem 0;
}

/* ===== Inline spinner ===== */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 149, 0, 0.3);
  border-top-color: var(--pico-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Utilities ===== */
.mt-0  { margin-top: 0 !important; }
.mb-0  { margin-bottom: 0 !important; }
.mb-1  { margin-bottom: 0.5rem !important; }
.mb-2  { margin-bottom: 1rem !important; }
.mt-1  { margin-top: 0.5rem !important; }
.text-muted { color: var(--pico-muted-color); }
.w-100 { width: 100%; }
.text-right { text-align: right; }
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .verify-card {
    padding: 1.75rem 1.25rem;
  }

  .verify-logo {
    width: 55%;
    max-width: 180px;
    margin-bottom: 1.25rem;
  }

  table .actions {
    flex-direction: column;
  }

  nav.site-nav .nav-inner {
    gap: 1rem;
  }
}
