:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-d: #0284c7;
  --ok: #4ade80;
  --err: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, #1e3a5f, var(--bg));
  color: var(--text);
  padding: 2rem 1rem;
}

.card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 12px;
  padding: 1.75rem 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
}

.lead {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.field select {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  cursor: pointer;
}

.estado-line {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
}

.estado-line.warn {
  color: #fecaca;
}

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

.file-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.file-wrap input[type="file"] {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.file-btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #0f172a;
  font-weight: 700;
  border-radius: 8px;
  border: none;
}

.file-wrap:hover .file-btn {
  background: #7dd3fc;
}

.file-name {
  flex: 1;
  min-width: 120px;
  font-size: 0.88rem;
  word-break: break-all;
}

.muted {
  color: var(--muted);
}

.btn {
  appearance: none;
  border: none;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
}

.btn.primary {
  background: var(--accent-d);
  color: white;
}

.btn.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.status.ok {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid var(--ok);
  color: #bbf7d0;
}

.status.err {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid var(--err);
  color: #fecaca;
}

/* Contador regresivo — esquina (hora Nicaragua / Managua) */
.countdown-corner {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  max-width: min(220px, calc(100vw - 1.5rem));
  text-align: right;
}

.countdown-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.countdown-digits {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fde68a;
  font-variant-numeric: tabular-nums;
}

.countdown-sublabel {
  font-size: 0.68rem;
  color: var(--muted);
}

.countdown-corner.expired .countdown-digits {
  color: #f87171;
}

.link-disabled-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.92);
  padding: 1.5rem;
}

.link-disabled-overlay[hidden] {
  display: none !important;
}

.link-disabled-msg {
  margin: 0;
  font-size: clamp(1.1rem, 4vw, 1.45rem);
  font-weight: 700;
  color: #fecaca;
  text-align: center;
  max-width: 22rem;
  line-height: 1.4;
}

body.link-disabled .card {
  pointer-events: none;
  user-select: none;
  filter: grayscale(0.35) brightness(0.85);
}
