/* ============================================================
   Acortador de URLs — estilos públicos (estilo bit.ly)
   ============================================================ */
:root {
  --navy: #0e1b33;
  --ink: #182234;
  --muted: #5b6b83;
  --line: #e3e8f0;
  --bg: #f6f8fb;
  --card: #ffffff;
  --accent: #ff5b2e;
  --accent-dark: #e8481d;
  --blue: #2f6bff;
  --ok: #128a4d;
  --warn: #b7791f;
  --danger: #d43c3c;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(14, 27, 51, .08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 620px; }

/* ——— Cabecera ——— */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  color: var(--navy);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.header-nav { display: flex; align-items: center; gap: 18px; }
.header-nav > a:not(.btn) { color: var(--muted); font-weight: 600; }

/* ——— Botones ——— */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .15s ease, transform .05s ease;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: #eef1f7; color: var(--ink); }
.btn-ghost:hover { background: #e2e7f0; }
.btn-lg { padding: 13px 26px; font-size: 16px; border-radius: 12px; }
.btn[disabled] { opacity: .6; cursor: default; }

/* ——— Hero / portada ——— */
.site-main { flex: 1; }
.hero {
  padding: 72px 0 56px;
  text-align: center;
  background:
    radial-gradient(1000px 400px at 50% -10%, rgba(255, 91, 46, .08), transparent 60%),
    var(--bg);
}
.hero h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
  color: var(--navy);
  letter-spacing: -.02em;
}
.hero-sub {
  margin: 16px auto 32px;
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
}

.shorten-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
}
.shorten-main { display: flex; gap: 10px; }
.shorten-main input {
  flex: 1;
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color .15s ease;
}
.shorten-main input:focus {
  outline: none;
  border-color: var(--accent);
}
.shorten-adv { margin-top: 10px; }
.toggle-adv {
  background: none;
  border: none;
  color: var(--blue);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 2px;
  font-family: inherit;
}
.adv-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.adv-field .prefix { color: var(--muted); font-size: 14px; white-space: nowrap; }
.adv-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.adv-field input:focus { outline: none; }

.form-error {
  margin-top: 12px;
  background: #fdeaea;
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
}

.hidden { display: none !important; }

/* ——— Resultado ——— */
.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  max-width: 680px;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
}
.result-label { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.result-url {
  display: inline-block;
  margin: 6px 0 12px;
  font-size: clamp(20px, 3.4vw, 26px);
  font-weight: 800;
  color: var(--navy);
  word-break: break-all;
}
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.result-qr { text-align: center; flex-shrink: 0; }
.result-qr img { border: 1px solid var(--line); border-radius: 10px; display: block; }
.result-qr a { font-size: 12px; color: var(--muted); }

.notice-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  max-width: 480px;
  margin: 0 auto;
  color: var(--muted);
}

/* ——— Ventajas ——— */
.features { padding: 26px 0 64px; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}
.feature-icon { font-size: 28px; margin-bottom: 8px; }
.feature h3 { color: var(--navy); font-size: 16px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14px; }

/* ——— Vista previa ——— */
.preview-page { padding: 64px 0; }
.preview-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 30px;
  text-align: center;
}
.preview-kicker {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .1em;
}
.preview-code {
  color: var(--navy);
  font-size: clamp(20px, 4vw, 30px);
  margin: 8px 0 14px;
  word-break: break-all;
}
.preview-dest { color: var(--muted); margin-bottom: 14px; word-break: break-all; }
.preview-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}
.preview-qr { margin: 6px 0 16px; border: 1px solid var(--line); border-radius: 12px; }
.preview-actions { margin: 10px 0 18px; }
.preview-note { color: var(--muted); font-size: 13px; }
.preview-note code { background: #eef1f7; padding: 2px 6px; border-radius: 6px; }

.badge {
  display: inline-block;
  border-radius: 99px;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.badge-ok { background: #e5f5ec; color: var(--ok); }
.badge-off { background: #eef1f7; color: var(--muted); }
.badge-exp { background: #fdf3e0; color: var(--warn); }

/* ——— Errores 404/410 ——— */
.error-page { padding: 80px 0; text-align: center; }
.error-card { padding: 30px; }
.error-code {
  font-size: 72px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -.04em;
}
.error-page h1 { color: var(--navy); margin: 6px 0 10px; }
.error-msg { color: var(--muted); margin-bottom: 24px; }

/* ——— Pie ——— */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 18px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

/* ——— Responsive ——— */
@media (max-width: 760px) {
  .hero { padding: 48px 0 40px; }
  .shorten-main { flex-direction: column; }
  .features-grid { grid-template-columns: 1fr; }
  .result-card { flex-direction: column; text-align: center; }
  .result-actions { justify-content: center; }
  .footer-inner { justify-content: center; text-align: center; }
}
