/* ============================================================
   Plantilla de tracker BitTorrent :: estética terminal CRT ámbar
   ============================================================ */

:root {
  --bg:        #14110d;
  --bg-raised: #1c1812;
  --bg-input:  #0f0d0a;
  --amber:     #ffb000;
  --amber-dim: #8a6d3b;
  --amber-soft:#caa15a;
  --fg:        #e8dcc8;
  --fg-dim:    #9a8f7a;
  --green:     #7fae84;
  --red:       #c1666b;
  --rule:      #332b1f;
  --radius:    2px;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
}

body::before {
  /* leve textura de scanlines, sutil, no animada (respeta reduced-motion por defecto) */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 176, 0, 0.015) 0px,
    rgba(255, 176, 0, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 999;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ---------- Ventana de terminal (elemento firma) ---------- */

.term {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 22px;
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1f1a13;
  border-bottom: 1px solid var(--rule);
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber-dim);
}
.term-dot.r { background: #6e4747; }
.term-dot.y { background: #7a652f; }
.term-dot.g { background: #4d6b50; }

.term-title {
  margin-left: 8px;
  color: var(--fg-dim);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.term-body { padding: 18px 20px; }

/* ---------- Header / branding ---------- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.logo {
  font-size: 21px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: -0.01em;
}
.logo .dim { color: var(--fg-dim); font-weight: 400; }

.nav {
  display: flex;
  gap: 18px;
  font-size: 13.5px;
  align-items: baseline;
}
.nav span.user { color: var(--amber-soft); }

/* ---------- Prompt / búsqueda ---------- */

.prompt-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--fg-dim);
}
.prompt-line .ps1 { color: var(--green); }
.prompt-line .ps1 .path { color: var(--amber-soft); }

.search-row {
  display: flex;
  gap: 0;
  background: var(--bg-input);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.search-row .prefix {
  padding: 11px 4px 11px 12px;
  color: var(--green);
}
.search-row input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14.5px;
  padding: 11px 12px 11px 4px;
  caret-color: var(--amber);
}
.search-row input::placeholder { color: var(--fg-dim); }
.search-row input:focus { outline: none; }
.search-row .cursor {
  width: 8px;
  background: var(--amber);
  margin: 11px 10px 11px 0;
  animation: blink 1.1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .search-row .cursor { animation: none; opacity: .6; }
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Section labels ---------- */

.section-label {
  font-size: 13px;
  color: var(--fg-dim);
  margin: 30px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.section-label .cmd { color: var(--green); }
.section-label .flag { color: var(--amber-soft); }

/* ---------- Tabla de torrents ---------- */

table.torrents {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.torrents th {
  text-align: left;
  font-weight: 400;
  color: var(--fg-dim);
  padding: 6px 10px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.torrents td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
table.torrents tr:hover td { background: rgba(255, 176, 0, 0.03); }
table.torrents td.name { color: var(--fg); }
table.torrents td.name a { color: var(--fg); }
table.torrents td.name a:hover { color: var(--amber); }
table.torrents td.rank { color: var(--amber-dim); width: 28px; }
table.torrents td.seeds { color: var(--green); }
table.torrents td.peers { color: var(--red); }
table.torrents td.num { font-variant-numeric: tabular-nums; }
table.torrents .uploader { color: var(--fg-dim); }

.empty-row td {
  color: var(--fg-dim);
  font-style: normal;
  padding: 18px 10px;
}

/* ---------- Botones / formularios (login, registro, upload) ---------- */

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--fg-dim);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="file"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  padding: 10px 12px;
}
.field input:focus { outline: none; border-color: var(--amber-dim); }

.btn {
  display: inline-block;
  background: var(--amber);
  color: #1a1410;
  border: none;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  cursor: pointer;
}
.btn:hover { background: var(--amber-soft); }
.btn:disabled { background: var(--amber-dim); cursor: default; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--fg);
}
.btn-ghost:hover { border-color: var(--amber-dim); background: transparent; }

.msg {
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: none;
}
.msg.show { display: block; }
.msg.error { background: rgba(193, 102, 107, 0.12); color: var(--red); border: 1px solid rgba(193,102,107,0.3); }
.msg.ok { background: rgba(127, 174, 132, 0.12); color: var(--green); border: 1px solid rgba(127,174,132,0.3); }

.auth-wrap {
  max-width: 420px;
  margin: 80px auto;
  padding: 0 20px;
}

.helper-text {
  font-size: 12.5px;
  color: var(--fg-dim);
  margin-top: 18px;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-dim);
}
.site-footer .stat strong { color: var(--amber-soft); }

@media (max-width: 640px) {
  table.torrents .col-uploader,
  table.torrents .col-uploaded { display: none; }
  .site-header { flex-direction: column; align-items: flex-start; }
}
