/* =========================================================
   Tema rojo sobre blanco — overrides sobre PicoCSS v2
   ========================================================= */

:root {
  --brand-red: #c1272d;
  --brand-red-dark: #8b1a1f;
  --brand-red-soft: #fdecee;
  --brand-red-50: #fff5f6;
  --brand-white: #ffffff;

  --pico-primary: var(--brand-red);
  --pico-primary-background: var(--brand-red);
  --pico-primary-border: var(--brand-red);
  --pico-primary-hover: var(--brand-red-dark);
  --pico-primary-hover-background: var(--brand-red-dark);
  --pico-primary-hover-border: var(--brand-red-dark);
  --pico-primary-focus: rgba(193, 39, 45, 0.25);
  --pico-primary-inverse: #ffffff;

  --pico-color-red-500: var(--brand-red);
  --pico-color-red-550: var(--brand-red-dark);
  --pico-color-red-50: var(--brand-red-50);

  --pico-background-color: var(--brand-white);
  --pico-card-background-color: var(--brand-white);
  --pico-form-element-background-color: var(--brand-white);
  --pico-form-element-border-color: #d9d9d9;
  --pico-form-element-focus-color: var(--brand-red);
}

/* ===== Layout general ===== */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 2rem;
}

/* ===== Header / logo ===== */
.site-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 1.5rem;
}

.site-header .logo {
  height: 40px;
  width: auto;
}

.site-header .brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-red);
  margin: 0;
}

/* ===== Home: search card ===== */
.search-card {
  max-width: 520px;
  width: 100%;
  margin-inline: auto;
  padding: 1.5rem;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.search-card h1 {
  margin-top: 0;
  color: var(--brand-red);
}

.search-card .lede {
  color: #555;
  margin-bottom: 1.25rem;
}

/* ===== Ticket result ===== */
.ticket-card {
  max-width: 640px;
  width: 100%;
  margin-inline: auto;
  padding: 1.5rem;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.ticket-card h1 {
  margin-top: 0;
  color: var(--brand-red);
}

.ticket-uuid {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--brand-red-50);
  border: 1px solid #f3d4d7;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.95rem;
}
.ticket-uuid .muted {
  color: #777;
  font-weight: 600;
}
.ticket-uuid code {
  background: transparent;
  color: var(--brand-red-dark);
  font-size: 0.95rem;
  word-break: break-all;
}

.doc-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--brand-red);
  color: var(--brand-red);
  background: var(--brand-white);
  transition: background 0.15s ease, color 0.15s ease;
}
.doc-link:hover,
.doc-link:focus {
  background: var(--brand-red);
  color: #fff;
}
.doc-link.primary {
  background: var(--brand-red);
  color: #fff;
}
.doc-link.primary:hover,
.doc-link.primary:focus {
  background: var(--brand-red-dark);
  border-color: var(--brand-red-dark);
}

.copy-btn {
  margin: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  background: var(--brand-white);
  color: var(--brand-red);
  border: 1px solid var(--brand-red);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.copy-btn:hover,
.copy-btn:focus {
  background: var(--brand-red);
  color: #fff;
}
.copy-btn.copied,
.copy-btn.copied:hover {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

.back-link {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

/* ===== Not found ===== */
.not-found {
  max-width: 520px;
  margin-inline: auto;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: var(--brand-red-soft);
  border: 1px solid var(--brand-red);
  color: var(--brand-red-dark);
}
.not-found h1 {
  color: var(--brand-red-dark);
  margin-top: 0;
}

/* ===== Error de conexión ===== */
.error-box {
  max-width: 520px;
  margin-inline: auto;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: #f5f5f5;
  border: 1px solid #c0c0c0;
  color: #333;
}
.error-box h1 {
  color: #b00020;
  margin-top: 0;
}
.error-box .muted {
  color: #777;
  font-size: 0.9rem;
  word-break: break-all;
}

[aria-busy="true"] {
  position: relative;
  overflow: hidden;
}
[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(193, 39, 45, 0.08),
    transparent
  );
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  color: #888;
  font-size: 0.85rem;
  padding: 1rem 0;
  border-top: 1px solid #eee;
  margin-top: 2rem;
}
