/* VidZippy — paleta tomada del logo: degradado magenta -> azul sobre fondo
   oscuro casi negro con un ligero sesgo azul. */

:root {
  --bg:          #0B0D12;
  --bg-soft:     #10131A;
  --surface:     #151922;
  --surface-2:   #1B2029;
  --border:      #262C38;
  --border-soft: #1E242E;

  --text:        #E7EAF0;
  --text-dim:    #98A1B2;
  --text-faint:  #6B7486;

  --brand-1:     #A21CF0;
  --brand-2:     #2C6FFF;
  --brand-3:     #16A9FF;
  --brand-grad:  linear-gradient(95deg, #A21CF0 0%, #5B3BF5 45%, #1E86FF 100%);

  --ok:          #38D399;
  --warn:        #E0A63E;
  --err:         #FF6B6B;

  --radius:      14px;
  --radius-sm:   10px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand-3); }

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------- Cabecera ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 13, 18, 0.88);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-link { display: flex; align-items: center; flex: none; }
.logo-link img { height: 30px; width: auto; display: block; }

.header-spacer { flex: 1 1 auto; }

.header-actions { display: flex; align-items: center; gap: 8px; }

/* Selector de idioma y menú: <details> nativo, sin JavaScript. */
.pop { position: relative; }

.pop > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
  user-select: none;
}

.pop > summary::-webkit-details-marker { display: none; }
.pop > summary:hover { color: var(--text); border-color: #333B4A; }
.pop[open] > summary { color: var(--text); border-color: #3A4354; }

.pop-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.pop-panel a,
.pop-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
}

.pop-panel a:hover,
.pop-panel button:hover { background: var(--surface-2); }

.pop-panel a.current { color: var(--brand-3); }

.pop-sep { height: 1px; background: var(--border); margin: 6px 4px; }

.pop-head {
  padding: 6px 11px 4px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* ---------------- Estructura ---------------- */

main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 16px 64px;
}

main.narrow { max-width: 440px; padding-top: 34px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.card + .card { margin-top: 14px; }

h1.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}

.page-sub { color: var(--text-dim); margin: 0 0 20px; font-size: 0.92rem; }

h2.section-title {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0 0 14px;
}

.auth-logo {
  display: block;
  margin: 0 auto 22px;
  height: 42px;
  width: auto;
}

.auth-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.auth-sub {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 0 0 22px;
}

.auth-alt {
  text-align: center;
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.auth-alt a { text-decoration: none; font-weight: 500; }
.auth-alt a:hover { text-decoration: underline; }

/* ---------------- Formularios ---------------- */

label.field {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 16px 0 6px;
}

label.field:first-of-type { margin-top: 0; }

input[type=text], input[type=email], input[type=password],
input[type=url], input[type=number], select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%2398A1B2' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

input:focus, select:focus { outline: none; border-color: var(--brand-2); }

input::placeholder { color: var(--text-faint); }

.code-input {
  text-align: center;
  font-family: var(--mono);
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  padding: 14px;
}

.row { display: flex; gap: 12px; }
.row > * { flex: 1 1 0; min-width: 0; }

.hint {
  font-size: 0.76rem;
  color: var(--text-faint);
  margin-top: 6px;
  line-height: 1.5;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
}

.checkbox-row input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--brand-2); }
.checkbox-row label { font-size: 0.92rem; color: var(--text); }

/* ---------------- Botones ---------------- */

.btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--brand-grad);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:active:not(:disabled) { filter: brightness(0.92); }

.btn-quiet {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 500;
}

.btn-quiet:hover:not(:disabled) { color: var(--text); border-color: #333B4A; }

.btn-success { background: var(--ok); color: #05271B; }

.btn-sm {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-top: 14px;
  width: 100%;
  text-align: center;
  text-decoration: underline;
}

.btn-link:hover { color: var(--text); }

/* ---------------- Avisos ---------------- */

.alert {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  line-height: 1.5;
  margin-bottom: 16px;
  border: 1px solid;
}

.alert-error  { background: rgba(255,107,107,.08); border-color: rgba(255,107,107,.5); color: #ff9d9d; }
.alert-ok     { background: rgba(56,211,153,.08);  border-color: rgba(56,211,153,.45); color: #6fe0b6; }
.alert-warn   { background: rgba(224,166,62,.08);  border-color: rgba(224,166,62,.5);  color: #e8bd6b; }

.warn-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(224,166,62,.5);
  border-radius: var(--radius-sm);
  background: rgba(224,166,62,.07);
  color: #e8bd6b;
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ---------------- Descargador ---------------- */

.mode-group { display: flex; gap: 8px; margin-top: 6px; }

.mode-group label {
  flex: 1 1 0;
  text-align: center;
  padding: 11px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.85rem;
  user-select: none;
}

.mode-group input { position: absolute; opacity: 0; pointer-events: none; }

.mode-group label:has(input:checked) {
  border-color: var(--brand-2);
  background: rgba(44, 111, 255, 0.12);
  color: var(--text);
}

.info-box {
  display: none;
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  gap: 12px;
  align-items: center;
}

.info-box.show { display: flex; }
.info-box img { width: 88px; border-radius: 8px; flex: none; }
.info-box .meta { font-size: 0.8rem; color: var(--text-dim); min-width: 0; }
.info-box .meta strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 3px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.progress-wrap { display: none; margin-top: 20px; }
.progress-wrap.show { display: block; }

.progress-bar-bg {
  width: 100%;
  height: 9px;
  border-radius: 6px;
  background: var(--bg-soft);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--brand-grad);
  transition: width 0.45s ease;
}

.progress-wrap.busy .progress-bar-fill {
  transition: none;
  width: 100% !important;
  background-image: linear-gradient(115deg,
    #A21CF0 0 30%, #5B3BF5 30% 50%, #1E86FF 50% 80%, #5B3BF5 80% 100%);
  background-size: 2.2rem 100%;
  animation: slide-stripes 0.9s linear infinite;
}

@keyframes slide-stripes {
  from { background-position: 0 0; }
  to   { background-position: 2.2rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-wrap.busy .progress-bar-fill { animation: none; }
  .progress-bar-fill { transition: none; }
}

.progress-status {
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.error-box {
  display: none;
  margin-top: 16px;
  padding: 12px;
  background: rgba(255,107,107,.07);
  border: 1px solid rgba(255,107,107,.45);
  border-radius: var(--radius-sm);
  color: #ff9d9d;
  font-size: 0.85rem;
  line-height: 1.5;
}

.error-box.show { display: block; }

.download-link { display: none; margin-top: 16px; }
.download-link.show { display: block; }

.raw-detail { margin-top: 10px; }

.raw-detail > summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text-dim);
  list-style: none;
  user-select: none;
}

.raw-detail > summary::-webkit-details-marker { display: none; }
.raw-detail > summary::before { content: "▸ "; }
.raw-detail[open] > summary::before { content: "▾ "; }

.raw-detail pre {
  margin: 8px 0 0;
  padding: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.71rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}

.quota-pill {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* ---------------- Listas de datos ---------------- */

.data-list { display: flex; flex-direction: column; }

.data-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.88rem;
}

.data-row:last-child { border-bottom: none; }
.data-row dt, .data-row .k { color: var(--text-dim); }
.data-row dd, .data-row .v { margin: 0; text-align: right; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}

.stat {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.stat .n {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat .l { font-size: 0.74rem; color: var(--text-dim); margin-top: 2px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 460px;
}

table.data th, table.data td {
  text-align: left;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

table.data th {
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
  border-bottom-color: var(--border);
}

.mono { font-family: var(--mono); font-size: 0.82rem; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.tag-ok { border-color: rgba(56,211,153,.5); color: var(--ok); }
.tag-warn { border-color: rgba(224,166,62,.5); color: var(--warn); }
.tag-err { border-color: rgba(255,107,107,.5); color: var(--err); }

.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input[type=number] { width: 86px; padding: 7px 9px; font-size: 0.85rem; }

.empty {
  color: var(--text-faint);
  font-size: 0.88rem;
  padding: 12px 0;
}

/* ---------------- Espacio en servidor (admin) ---------------- */

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.83rem;
  color: var(--text-dim);
}

.status-line:last-child { border-bottom: none; }
.status-line .fname { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-line .fmeta { white-space: nowrap; font-size: 0.78rem; }
.status-empty { color: var(--ok); font-size: 0.86rem; }

.status-disk {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.status-actions { display: flex; gap: 8px; margin-top: 14px; }
.status-actions .btn { flex: 1 1 0; margin-top: 0; }

/* ---------------- Pie ---------------- */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 18px 16px 26px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.76rem;
}

/* ---------------- Móvil ---------------- */

@media (max-width: 560px) {
  .card { padding: 18px; }
  main { padding: 16px 12px 52px; }
  main.narrow { padding-top: 24px; }
  .logo-link img { height: 26px; }
  .header-inner { padding: 9px 12px; }
  .pop > summary { padding: 7px 9px; font-size: 0.78rem; }
  .mode-group { flex-wrap: wrap; }
  .mode-group label { flex: 1 1 30%; }
  .code-input { font-size: 1.35rem; letter-spacing: 0.3em; }
}

/* ---------------- Página de inicio pública ---------------- */

.header-signin {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
}

.header-signin:hover { color: var(--text); border-color: #333B4A; }

main.landing { max-width: 880px; }

.hero {
  text-align: center;
  padding: 30px 0 8px;
}

.hero-logo {
  width: min(320px, 78%);
  height: auto;
  display: block;
  margin: 0 auto 22px;
}

.hero-title {
  font-size: clamp(1.9rem, 6.5vw, 3rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  text-wrap: balance;
  background: linear-gradient(95deg, #C15CF5, #7C6BFF 45%, #4FA3FF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 1.02rem;
  max-width: 46ch;
  margin: 0 auto 26px;
  text-wrap: pretty;
}

.hero-cta {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 430px;
  margin: 0 auto;
}

.hero-cta .btn { margin-top: 0; flex: 1 1 190px; }

.platforms-label {
  margin: 34px 0 10px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.platforms {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.platforms li {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.block { margin-top: 54px; }

.block-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  text-align: center;
}

.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.steps-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.step-n {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.steps-list h3, .feature h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 600;
}

.steps-list p, .feature p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.89rem;
  line-height: 1.55;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.invite-band {
  margin-top: 54px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 22px;
}

.invite-band h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.invite-band p {
  margin: 0 auto 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
  max-width: 44ch;
}

.invite-band .btn { max-width: 280px; margin: 0 auto; }

.legal-note {
  margin: 30px auto 0;
  max-width: 56ch;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.76rem;
  line-height: 1.55;
}

@media (max-width: 560px) {
  .hero { padding-top: 18px; }
  .hero-logo { width: 74%; margin-bottom: 18px; }
  .block { margin-top: 40px; }
  .steps-list li { padding: 15px 16px; gap: 13px; }
}
