/* /assets/css/styles.css — OneCut Design System
   Inter · #6B4EFF · Apple / Linear / Vercel aesthetic
   ─────────────────────────────────────────────────── */

/* ════════════════════════════════════════
   VARIABLES
════════════════════════════════════════ */
:root {
  /* Fuente */
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system,
          BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Acento único */
  --accent:       #6B4EFF;
  --accent-hover: #5538F0;
  --accent-dim:   rgba(107, 78, 255, 0.10);
  --accent-glow:  0 0 0 3px rgba(107, 78, 255, 0.18);

  /* Superficie */
  --bg:        #FFFFFF;
  --bg-subtle: #F8F8FA;
  --bg-glass:  rgba(255, 255, 255, 0.85);

  /* Texto */
  --text:       #0F0F10;
  --text-muted: #6B6B7A;
  --text-faint: #B0B0BE;

  /* Bordes */
  --border:       rgba(0, 0, 0, 0.07);
  --border-hover: rgba(0, 0, 0, 0.14);

  /* Estados */
  --ok:      #16A34A;
  --ok-dim:  rgba(22, 163, 74, 0.10);
  --err:     #DC2626;
  --err-dim: rgba(220, 38, 38, 0.09);

  /* Forma */
  --radius:    12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Sombras */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-acc: 0 8px 24px rgba(107, 78, 255, 0.30);

  /* Motion */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur:       0.22s;
}

/* Modo oscuro */
[data-theme="dark"] {
  --bg:           #0A0A0B;
  --bg-subtle:    #131316;
  --bg-glass:     rgba(10, 10, 11, 0.88);
  --text:         #F5F5F7;
  --text-muted:   #8E8EA0;
  --text-faint:   #44444E;
  --border:       rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --accent-dim:   rgba(107, 78, 255, 0.16);
  --ok-dim:       rgba(22, 163, 74, 0.13);
  --err-dim:      rgba(220, 38, 38, 0.12);
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.5);
}

/* ════════════════════════════════════════
   RESET
════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  overflow-x: hidden;
}

a  { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input  { font-family: inherit; }

/* ════════════════════════════════════════
   LAYOUT — contenedor central
════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ════════════════════════════════════════
   HEADER
════════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  transition: background var(--dur) var(--ease);
}

.header-inner {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  transition: opacity var(--dur);
}
.logo:hover { opacity: 0.65; }

.logo-symbol {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  animation: symbolPulse 5s ease-in-out infinite;
}

.logo-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* Botón de tema */
.btn-theme {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}
.btn-theme:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--bg-subtle);
}

/* Iconos sol / luna según tema */
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* ════════════════════════════════════════
   HERO
════════════════════════════════════════ */
.hero { padding: 88px 0 64px; }

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Badge superior */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 32px;
  background: var(--bg-subtle);
  animation: fadeDown 0.5s var(--ease) both;
}

.badge-cut {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.badge-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Título hero */
.hero-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: clamp(40px, 7.5vw, 64px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.045em;
  margin-bottom: 20px;
}

.hero-line {
  display: block;
  opacity: 0;
  animation: fadeUp 0.55s var(--ease) forwards;
  animation-delay: calc(0.12s + var(--i, 0) * 0.11s);
}

.hero-accent { color: var(--accent); }

/* Sub */
.hero-sub {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 52px;
  opacity: 0;
  animation: fadeUp 0.55s var(--ease) forwards;
  animation-delay: calc(0.12s + var(--i, 0) * 0.11s);
}

/* ════════════════════════════════════════
   CUTTER — el formulario
════════════════════════════════════════ */
.cutter {
  width: 100%;
  max-width: 560px;
  opacity: 0;
  animation: fadeUp 0.6s var(--ease) forwards;
  animation-delay: calc(0.12s + var(--i, 0) * 0.11s);
}

/* ── Campo URL ── */
.url-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  padding: 0 12px;
  margin-bottom: 8px;
  transition: border-color var(--dur), box-shadow var(--dur);
}

.url-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
  background: var(--bg);
}

/* Dot de validación */
.url-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: transparent;
  margin-right: 12px;
  transition: background 0.25s, box-shadow 0.25s;
}
.url-dot.ok  { background: var(--ok);  box-shadow: 0 0 0 3px var(--ok-dim); }
.url-dot.err { background: var(--err); box-shadow: 0 0 0 3px var(--err-dim); }

.input-url {
  flex: 1;
  height: 52px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  caret-color: var(--accent);
  min-width: 0;
}
.input-url::placeholder { color: var(--text-faint); }

/* Botón pegar */
.btn-paste {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}
.btn-paste:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.btn-paste:active { transform: scale(0.95); }

/* ── Campo alias ── */
.alias-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  padding: 0 14px;
  margin-bottom: 10px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.alias-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
  background: var(--bg);
}

.input-alias {
  flex: 1;
  height: 44px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: none;
  outline: none;
  caret-color: var(--accent);
  min-width: 0;
  padding-left: 6px;
}
.input-alias::placeholder { color: var(--text-faint); font-weight: 400; }

.alias-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  flex-shrink: 0;
  margin-left: 8px;
  transition: color var(--dur);
  white-space: nowrap;
}
.alias-hint.ok  { color: var(--ok); }
.alias-hint.err { color: var(--err); }

/* ── Botón acortar ── */
.btn-cut {
  position: relative;
  width: 100%;
  height: 52px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow: hidden;
  transition:
    background var(--dur),
    transform 0.15s var(--ease-back),
    box-shadow var(--dur);
}

.btn-cut:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: var(--shadow-acc);
  transform: translateY(-2px);
}
.btn-cut:active:not(:disabled) {
  transform: translateY(0) scale(0.988);
  box-shadow: none;
}
.btn-cut:disabled { opacity: 0.55; cursor: not-allowed; }

/* Contenido idle */
.btn-idle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.18s, transform 0.18s;
}
.cut-scissors { font-size: 17px; }

/* Loading state */
.btn-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.18s, transform 0.18s;
}

.btn-cut.is-loading .btn-idle    { opacity: 0; transform: scale(0.9); }
.btn-cut.is-loading .btn-loading { opacity: 1; transform: scale(1); }

/* Spinner */
.spinner {
  width: 19px;
  height: 19px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* ── Error ── */
.msg-error {
  display: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--err);
  background: var(--err-dim);
  border: 1px solid rgba(220,38,38,0.18);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  margin-top: 10px;
  line-height: 1.5;
}
.msg-error.show { display: block; }

/* ── Resultado ── */
.result {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease);
  margin-top: 0;
}
.result.show {
  max-height: 180px;
  margin-top: 12px;
}

.result-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.35s var(--ease) 0.08s,
    transform 0.35s var(--ease) 0.08s;
}
.result.show .result-inner {
  opacity: 1;
  transform: translateY(0);
}

.result-cut {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  animation: none;
}
.result.show .result-cut { animation: cutReveal 0.55s var(--ease) 0.1s both; }

.result-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.result-link {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
  word-break: break-all;
  transition: opacity var(--dur);
}
.result-link:hover { opacity: 0.72; }

/* Botones del resultado */
.result-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.btn-result {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
  transition: color var(--dur), border-color var(--dur), background var(--dur), transform 0.12s;
}
.btn-result:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.btn-result:active { transform: scale(0.93); }

.btn-result.copied {
  color: var(--ok);
  border-color: var(--ok);
  background: var(--ok-dim);
}

/* ════════════════════════════════════════
   TRUST BAR (beneficios)
════════════════════════════════════════ */
.trust {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.trust-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trust-cut {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.trust-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.trust-sep {
  font-size: 20px;
  color: var(--border-hover);
  line-height: 1;
  user-select: none;
}

/* Microcopy de soporte bajo los beneficios */
.trust-microcopy {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
  text-align: center;
  margin-top: 14px;
  line-height: 1.6;
}

/* ════════════════════════════════════════
   MANIFIESTO — layout dos columnas
════════════════════════════════════════ */
.manifesto {
  padding: 80px 0 96px;
  border-top: 1px solid var(--border);
}

.manifesto-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0 56px;
  align-items: start;
}

/* Columna izquierda */
.manifesto-left {
  position: sticky;
  top: 80px;
}

.manifesto-cut {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.manifesto-heading {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.manifesto-sub {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--text);
}

/* Columna derecha */
.manifesto-right {
  border-left: 2px solid var(--accent);
  padding-left: 40px;
}

.manifesto-body {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.manifesto-body p {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--text-muted);
}

.manifesto-lead {
  font-size: 20px !important;
  font-weight: 600 !important;
  letter-spacing: -0.025em;
  line-height: 1.4 !important;
  color: var(--text) !important;
}

.manifesto-close {
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em;
  color: var(--text) !important;
}

.manifesto-sig {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
  margin-top: 28px;
  font-style: italic;
}

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 20px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-brand {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.footer-note {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
}

/* ════════════════════════════════════════
   MODAL QR
════════════════════════════════════════ */
.qr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  animation: fadeIn 0.2s forwards;
}
.qr-overlay[hidden] { display: none; }

.qr-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: fit-content;
  height: fit-content;
  z-index: 101;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: scaleUp 0.25s var(--ease-back) forwards;
  min-width: 268px;
}
.qr-modal[hidden] { display: none; }

.qr-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background var(--dur), color var(--dur);
}
.qr-close:hover { background: var(--bg-subtle); color: var(--text); }

.qr-symbol {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.qr-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
/* El QR se renderiza como <img> insertada por qrcode.toDataURL */
#qrCanvas {
  display: flex;
  align-items: center;
  justify-content: center;
}
#qrCanvas img {
  display: block;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}
.qr-caption {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  word-break: break-all;
  text-align: center;
  max-width: 220px;
}

/* ════════════════════════════════════════
   CONFETTI
════════════════════════════════════════ */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ════════════════════════════════════════
   PÁGINAS STATUS (off / 404)
════════════════════════════════════════ */
.page-status { background: var(--bg); }

.status-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}

.status-wrap {
  width: 100%;
  max-width: 520px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Código 404 */
.s404-code {
  font-size: clamp(80px, 16vw, 120px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  color: var(--border-hover);
}

.status-symbol {
  font-size: 18px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.status-title {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text);
}

.status-sub {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.6;
}

.btn-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  border-radius: var(--radius);
  transition: background var(--dur), transform 0.15s var(--ease-back), box-shadow var(--dur);
}
.btn-status:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-acc);
  transform: translateY(-2px);
}

/* Mini cutter en 404 */
.mini-cutter { width: 100%; margin-top: 4px; }
.status-404 { gap: 10px; }

/* Animación de entrada para páginas status */
.anim {
  opacity: 0;
  animation: fadeUp 0.5s var(--ease) calc(0.1s + var(--d, 0) * 0.1s) forwards;
}

/* ════════════════════════════════════════
   KEYFRAMES
════════════════════════════════════════ */

/* Entrada desde abajo */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Entrada desde arriba */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fade puro */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scale desde centro */
@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.88) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Pulso sutil del símbolo —╱— en el logo */
@keyframes symbolPulse {
  0%, 100% { opacity: 0.85; letter-spacing: 0.04em; }
  50%       { opacity: 1;    letter-spacing: 0.09em; }
}

/* Animación de "corte" al revelar el resultado */
@keyframes cutReveal {
  0%   { clip-path: inset(0 100% 0 0); opacity: 0; }
  25%  { opacity: 1; }
  100% { clip-path: inset(0 0% 0 0);   opacity: 1; }
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 700px) {
  .hero { padding: 60px 0 48px; }

  /* Manifiesto: una columna en mobile */
  .manifesto-grid {
    grid-template-columns: 1fr;
    gap: 32px 0;
  }
  .manifesto-left { position: static; }
  .manifesto-right {
    border-left: 2px solid var(--accent);
    padding-left: 24px;
  }

  .trust-sep { display: none; }
  .trust-inner { flex-direction: column; align-items: flex-start; padding-left: 0; }

  .footer-inner { flex-direction: column; text-align: center; gap: 6px; }

  /* Alias: siempre visible — incluso en pantallas pequeñas como iPhone SE */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
