/* Clipealo — diseño moderno, colores vivos, responsive */
:root {
  --bg: #14091f;
  --bg2: #1d0b2e;
  --card: rgba(255, 255, 255, 0.06);
  --card-solid: #22103a;
  --border: rgba(255, 255, 255, 0.12);
  --text: #f6f2ff;
  --muted: #c3b2e3;
  --pink: #ff2e63;
  --orange: #ff7a18;
  --violet: #8b5cf6;
  --cyan: #06b6d4;
  --green: #22c55e;
  --red: #ef4444;
  --grad: linear-gradient(135deg, #ff2e63, #ff7a18 55%, #8b5cf6);
  --grad-soft: linear-gradient(135deg, rgba(255, 46, 99, 0.22), rgba(139, 92, 246, 0.22));
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(900px 500px at 85% -10%, rgba(139, 92, 246, 0.35), transparent 60%),
    radial-gradient(700px 420px at -10% 10%, rgba(255, 46, 99, 0.28), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  min-height: 100vh;
}

a { color: #ffb3c6; }
a:hover { color: #fff; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px 60px; }

/* ---------- Barra superior ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 0 6px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { width: 46px; height: 46px; border-radius: 13px; box-shadow: var(--shadow); }
.brand b {
  font-size: 28px; letter-spacing: -0.5px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand small { display: block; font-size: 12px; color: var(--muted); letter-spacing: 0.4px; }
.topbar .spacer { flex: 1; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 6px 6px 14px; font-size: 14px;
}
.user-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 15px;
}
.plan-pill {
  background: var(--grad); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.topnav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topnav a {
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--border);
}
.topnav a:hover { background: rgba(255, 255, 255, 0.12); }
.linklike { background: none; border: none; color: #ffb3c6; cursor: pointer; font-size: 14px; padding: 0; text-decoration: underline; }

h1 { font-size: 26px; margin: 10px 0 4px; }
h2 { font-size: 19px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; color: var(--muted); }
.section-title { margin: 34px 0 12px; display: flex; align-items: baseline; gap: 10px; }
.section-title .sub { font-size: 13px; color: var(--muted); }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.card.hero {
  background: var(--grad-soft);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; font-size: 15px; color: var(--text);
  background: rgba(0, 0, 0, 0.35); border: 1.5px solid var(--border);
  border-radius: 12px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 46, 99, 0.25); }
select.input option { color: #111; }
textarea.input { resize: vertical; min-height: 70px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 8px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--pink); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label {
  padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--border);
  cursor: pointer; font-size: 14px; background: rgba(0, 0, 0, 0.25);
}
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--grad); border-color: transparent; color: #fff; font-weight: 700; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block; padding: 12px 22px; border: none; border-radius: 999px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 15px;
  cursor: pointer; text-decoration: none; text-align: center;
  box-shadow: 0 6px 18px rgba(255, 46, 99, 0.4);
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn-block { display: block; width: 100%; }
.btn-ghost {
  display: inline-block; padding: 10px 18px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.btn-sm { padding: 7px 13px; font-size: 13px; }

/* ---------- Alertas ---------- */
.alert {
  border-radius: 14px; padding: 14px 16px; margin-top: 16px; font-size: 14.5px; line-height: 1.45;
  border: 1px solid;
}
.alert.err { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.5); color: #fecaca; }
.alert.ok { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.5); color: #bbf7d0; }
.alert.warn { background: rgba(255, 122, 24, 0.14); border-color: rgba(255, 122, 24, 0.5); color: #fed7aa; }
.alert.info { background: rgba(6, 182, 212, 0.12); border-color: rgba(6, 182, 212, 0.45); color: #a5f3fc; }

/* ---------- Trabajos ---------- */
.job { padding: 18px 20px; }
.job-title { font-size: 17px; font-weight: 800; }
.job-title a { color: var(--text); text-decoration: none; }
.job-title a:hover { text-decoration: underline; }
.job-meta { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; background: rgba(255, 255, 255, 0.14); color: #fff;
}
.status-en_cola { background: #64748b; }
.status-descargando, .status-transcribiendo { background: var(--cyan); }
.status-subtitulando, .status-exportando { background: var(--violet); }
.status-listo { background: var(--green); }
.status-error { background: var(--red); }
.status-publicando { background: var(--orange); }
.progress { height: 8px; background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.bar { height: 100%; background: var(--grad); border-radius: 999px; transition: width 0.4s; }
.log {
  background: rgba(0, 0, 0, 0.45); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap;
  max-height: 220px; overflow: auto; font-family: ui-monospace, Consolas, monospace;
  color: #d8ccf5;
}
.hooks { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.hook {
  background: rgba(139, 92, 246, 0.18); border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
}

/* ---------- Clips: galería con miniaturas ---------- */
.clips {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px; margin-top: 12px;
}
.clip {
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; transition: transform 0.15s, box-shadow 0.15s;
}
.clip:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45); }
.clip .thumb {
  display: block; width: 100%; aspect-ratio: 9/16; object-fit: cover; background: #000;
}
.clip .thumb.ratio-1-1 { aspect-ratio: 1/1; }
.clip .thumb.ratio-4-5 { aspect-ratio: 4/5; }
.clip .thumb.ratio-16-9 { aspect-ratio: 16/9; }
.clip .body { padding: 10px 12px; }
.clip .title { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.clip .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.clip .actions { display: flex; gap: 8px; margin-top: 8px; }
.clip .actions a { font-size: 13px; font-weight: 700; }
.ratio-tag {
  display: inline-block; background: var(--grad); color: #fff;
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
}

/* ---------- Planes ---------- */
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.plan-card {
  background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 22px; position: relative;
}
.plan-card.current { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 46, 99, 0.25); }
.plan-card.featured { background: var(--grad-soft); border-color: rgba(255, 122, 24, 0.6); }
.plan-card h3 { font-size: 20px; margin: 0; }
.plan-card .price { font-size: 15px; color: var(--muted); margin: 6px 0 12px; }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 16px; font-size: 14px; line-height: 1.9; }
.plan-card ul li::before { content: "✓ "; color: var(--green); font-weight: 800; }
.plan-badge {
  position: absolute; top: -11px; right: 16px; background: var(--grad); color: #fff;
  font-size: 11.5px; font-weight: 800; padding: 4px 12px; border-radius: 999px;
}
.plan-banner {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  background: var(--grad-soft); border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius); padding: 16px 20px; margin-top: 16px;
}
.plan-banner .bar-wrap { flex: 1; min-width: 200px; }
.meter { height: 10px; background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }

/* ---------- Auth: login / registro ---------- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-wrap { width: 100%; max-width: 460px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand img { width: 76px; height: 76px; border-radius: 20px; box-shadow: 0 12px 32px rgba(255, 46, 99, 0.45); }
.auth-brand h1 {
  font-size: 34px; margin: 12px 0 4px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-brand p { color: var(--muted); margin: 0; font-size: 15px; }
.auth-card {
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px; padding: 30px 28px; box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.auth-card h2 { font-size: 22px; margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .input { padding: 13px 15px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.auth-switch a { font-weight: 800; }
.auth-error {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(239, 68, 68, 0.16); border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fecaca; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px;
}
.auth-error::before { content: "⚠️"; }
.auth-note {
  background: rgba(6, 182, 212, 0.12); border: 1px solid rgba(6, 182, 212, 0.4);
  color: #a5f3fc; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 16px;
}

/* ---------- Editor ---------- */
video.preview { width: 100%; max-height: 60vh; border-radius: 14px; background: #000; }
.preview-wrap { position: relative; max-width: 520px; margin: 0 auto; }
.preview-wrap video { width: 100%; border-radius: 14px; background: #000; display: block; }
.safe-zone {
  position: absolute; left: 0; right: 0; text-align: center;
  font-size: 12px; color: #fff; background: rgba(0, 0, 0, 0.45);
  padding: 4px; pointer-events: none;
}
.safe-zone.top { top: 0; border-radius: 14px 14px 0 0; }
.safe-zone.bottom { bottom: 0; border-radius: 0 0 14px 14px; }
.safe-zone.center { top: 50%; transform: translateY(-50%); background: transparent; border: 2px dashed rgba(255,255,255,0.5); height: 60%; }
.slider-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.slider-row input[type=range] { width: 100%; accent-color: var(--pink); }
.tabs { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.tabs button {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer; font-weight: 700; font-size: 14px;
}
.tabs button.active { background: var(--grad); border-color: transparent; }
.panel { display: none; }
.panel.active { display: block; }

.footer { text-align: center; margin-top: 40px; font-size: 13px; color: var(--muted); }
.footer b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .grid2, .grid3, .plans-grid { grid-template-columns: 1fr; }
  .brand b { font-size: 23px; }
  .topbar { gap: 10px; }
  .user-chip { font-size: 13px; }
  .auth-card { padding: 24px 20px; }
  .auth-brand h1 { font-size: 29px; }
  .clips { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  h1 { font-size: 22px; }
}
@media (max-width: 420px) {
  .clips { grid-template-columns: 1fr 1fr; }
  .clip .body { padding: 8px; }
}
