/* NASC TikTok — tema oscuro elegante */
:root {
  --bg-deep: #0a0a0f;
  --bg-card: rgba(18, 18, 28, 0.88);
  --bg-card-hover: rgba(28, 28, 42, 0.95);
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-tiktok: #00f2ea;
  --accent-pink: #ff0050;
  --accent-nasc: #10b981;
  --accent-nasc-dim: #059669;
  --gradient-brand: linear-gradient(135deg, var(--accent-tiktok), var(--accent-pink), var(--accent-nasc));
  --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 48px rgba(0, 0, 0, 0.45);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --font: "Outfit", system-ui, sans-serif;
  --font-brand: "Syne", var(--font);
  --container-max: min(100% - 2rem, 42rem);
  --container-pad: clamp(1rem, 4vw, 1.5rem);
  --touch-min: 48px;
  --bp-tablet: 640px;
  --bp-desktop: 1024px;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.55;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 242, 234, 0.12), transparent),
    radial-gradient(ellipse 50% 40% at 100% 20%, rgba(255, 0, 80, 0.1), transparent),
    radial-gradient(ellipse 45% 35% at 0% 80%, rgba(16, 185, 129, 0.08), transparent),
    linear-gradient(180deg, #0a0a0f 0%, #12121c 50%, #0a0a0f 100%);
  z-index: -2;
}

.bg-noise {
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: -1;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.header {
  text-align: center;
  padding: clamp(2rem, 6vw, 3.5rem) var(--container-pad) 1rem;
  padding-top: calc(clamp(2rem, 6vw, 3.5rem) + env(safe-area-inset-top, 0));
  animation: fadeDown 0.65s ease-out;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.65rem, 2vw, 1rem);
  margin-bottom: 0.75rem;
}

.logo-icon {
  width: clamp(42px, 10vw, 54px);
  height: clamp(42px, 10vw, 54px);
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(0, 242, 234, 0.35));
}

.logo-text {
  font-family: var(--font-brand);
  font-size: clamp(2.45rem, 9.5vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--gradient-brand);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s ease-in-out infinite;
}

.tagline {
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.tagline-sub {
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  font-weight: 600;
  color: #ffffff;
  max-width: 34rem;
  margin: 0.75rem auto 0;
  line-height: 1.45;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad) clamp(2.5rem, 6vw, 4rem);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.search-card {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: 1.25rem;
  animation: fadeUp 0.55s ease-out 0.1s both;
}

.input-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
  color: #ffffff;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input-group .btn-primary {
  width: 100%;
}

.input-field {
  position: relative;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.input-icon {
  display: flex;
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
  pointer-events: none;
  z-index: 1;
}

.url-input {
  width: 100%;
  min-width: 0;
  min-height: var(--touch-min);
  padding: 0.85rem 1rem 0.85rem 2.65rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.url-input::placeholder { color: var(--text-muted); }

.url-input:focus {
  border-color: rgba(0, 242, 234, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 242, 234, 0.12);
}

.hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--touch-min);
  padding: 0 1.35rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #0a0a0f;
  box-shadow: 0 4px 24px rgba(0, 242, 234, 0.2);
}

.btn-primary:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 0, 80, 0.25);
}

.btn-loader {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(10, 10, 15, 0.25);
  border-top-color: #0a0a0f;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Alert */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  animation: fadeUp 0.35s ease-out;
}

.alert-error {
  background: rgba(255, 0, 80, 0.12);
  border: 1px solid rgba(255, 0, 80, 0.35);
  color: #fda4af;
}

.alert-icon { flex-shrink: 0; margin-top: 0.1rem; }

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

/* Loader overlay */
.loader-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  margin-bottom: 1rem;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-tiktok);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.loader-text { color: var(--text-secondary); font-size: 0.95rem; }

/* Preview card */
.preview-card {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  animation: fadeUp 0.5s ease-out;
}

.preview-layout {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.preview-media {
  position: relative;
  width: min(100%, 17.5rem);
  max-width: 280px;
  margin-inline: auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 9 / 16;
  max-height: min(52vh, 22rem);
  background: #000;
  box-shadow: var(--shadow-md);
}

.preview-body {
  min-width: 0;
}

.preview-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-badge {
  position: absolute;
  bottom: 0.65rem;
  left: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.preview-title {
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.preview-author {
  font-size: 0.95rem;
  color: var(--accent-tiktok);
  font-weight: 500;
  margin-bottom: 0.85rem;
}

.preview-meta,
.preview-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preview-meta li,
.preview-stats li {
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  color: var(--text-secondary);
}

.preview-stats li {
  border: 1px solid rgba(0, 242, 234, 0.15);
}

.preview-stats li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Actions */
.action-section {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.action-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.btn-action {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
  text-decoration: none;
}

.btn-action--primary {
  background: linear-gradient(135deg, rgba(0, 242, 234, 0.2), rgba(16, 185, 129, 0.25));
  border-color: rgba(0, 242, 234, 0.35);
}

.btn-action--accent {
  background: linear-gradient(135deg, rgba(255, 0, 80, 0.15), rgba(124, 58, 237, 0.2));
  border-color: rgba(255, 0, 80, 0.3);
}

.btn-action--ghost {
  background: transparent;
}

.btn-action:not(:disabled):hover,
.btn-action--ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 242, 234, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Progress */
.progress-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-brand);
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem var(--container-pad) calc(2rem + env(safe-area-inset-bottom, 0));
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
}

.footer__social-title {
  margin: 1rem 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nasc-footer__social {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.nasc-footer__social a {
  font-size: 1.35rem;
  transition: transform var(--transition), filter var(--transition), opacity var(--transition);
}

.nasc-footer__social .social--instagram {
  color: #e1306c;
}

.nasc-footer__social .social--x {
  color: #ffffff;
}

.nasc-footer__social .social--github {
  color: #f0f6fc;
}

.nasc-footer__social .social--tiktok {
  color: #25f4ee;
}

.nasc-footer__social a:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

/* Animations */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

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

/* —— Tablet (640px+) —— */
@media (min-width: 640px) {
  :root {
    --container-max: min(100% - 3rem, 44rem);
    --container-pad: clamp(1.25rem, 3vw, 2rem);
  }

  .header {
    padding-bottom: 1.25rem;
  }

  .logo-icon {
    width: clamp(48px, 8vw, 58px);
    height: clamp(48px, 8vw, 58px);
  }

  .tagline-sub {
    max-width: 36rem;
  }

  .input-group {
    flex-direction: row;
    align-items: stretch;
  }

  .input-field {
    width: auto;
  }

  .input-group .btn-primary {
    width: auto;
    flex-shrink: 0;
    min-width: 7.5rem;
  }

  .preview-layout {
    grid-template-columns: minmax(10rem, 12.5rem) 1fr;
    align-items: start;
    gap: 1.5rem;
  }

  .preview-media {
    margin-inline: 0;
    width: 100%;
    max-width: none;
    max-height: 20rem;
  }

  .action-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* —— Desktop (1024px+) —— */
@media (min-width: 1024px) {
  :root {
    --container-max: min(100% - 4rem, 52rem);
    --container-pad: 2rem;
  }

  .header {
    padding-top: calc(3.5rem + env(safe-area-inset-top, 0));
    padding-bottom: 1.5rem;
  }

  .logo {
    gap: 1.1rem;
  }

  .logo-icon {
    width: 58px;
    height: 58px;
  }

  .logo-text {
    font-size: 4.25rem;
  }

  .tagline {
    font-size: 1.4rem;
  }

  .tagline-sub {
    font-size: 1rem;
    max-width: 40rem;
  }

  .search-card,
  .preview-card {
    padding: 2rem;
  }

  .preview-layout {
    grid-template-columns: minmax(11rem, 15rem) 1fr;
    gap: 2rem;
    margin-bottom: 1.75rem;
  }

  .preview-media {
    max-height: 24rem;
  }

  .preview-title {
    font-size: 1.4rem;
  }

  .action-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .footer {
    padding-top: 2.5rem;
    font-size: 0.9rem;
  }
}

/* —— Móvil estrecho —— */
@media (max-width: 380px) {
  .logo-text {
    letter-spacing: 0.08em;
    font-size: clamp(2rem, 11vw, 2.45rem);
  }

  .tagline {
    font-size: 1rem;
  }

  .btn {
    padding-inline: 1rem;
    font-size: 0.95rem;
  }

  .hint {
    font-size: 0.75rem;
  }
}

/* —— Tablet apaisado / móvil horizontal —— */
@media (max-height: 500px) and (orientation: landscape) {
  .header {
    padding-top: calc(1rem + env(safe-area-inset-top, 0));
    padding-bottom: 0.5rem;
  }

  .logo {
    margin-bottom: 0.35rem;
  }

  .tagline-sub {
    display: none;
  }

  .preview-media {
    max-height: min(70vh, 14rem);
  }
}

/* WhatsApp flotante */
.nasc-whatsapp-float {
  position: fixed;
  width: 56px;
  height: 56px;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  right: calc(1.25rem + env(safe-area-inset-right, 0px));
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  text-decoration: none;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s ease, background 0.2s ease;
}

.nasc-whatsapp-float:hover {
  background: #20ba5a;
  color: #fff;
  transform: scale(1.08);
}

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