/* ==========================================================================
   Safelink — design system
   Dark, modern, responsive-first. Shared by home page & countdown page.
   ========================================================================== */

:root {
  --bg: #070b14;
  --bg-soft: #0b1120;
  --card: rgba(255, 255, 255, 0.04);
  --card-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8edf7;
  --text-muted: #93a0b8;
  --text-dim: #63708a;
  --accent: #38bdf8;
  --accent-2: #2dd4bf;
  --gradient: linear-gradient(100deg, #38bdf8 0%, #2dd4bf 100%);
  --danger: #f87171;
  --success: #34d399;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ------------------------------------------------ decorative background -- */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.orb-1 { width: 520px; height: 520px; background: rgba(56, 189, 248, 0.14); top: -180px; left: -140px; }
.orb-2 { width: 460px; height: 460px; background: rgba(45, 212, 191, 0.12); top: 30%; right: -180px; }
.orb-3 { width: 380px; height: 380px; background: rgba(59, 130, 246, 0.1); bottom: -150px; left: 30%; }

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------------------------------------- header -- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.logo-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.35);
  color: #04121f;
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--card-strong); }

/* ----------------------------------------------------------------- hero -- */
.hero { padding: 64px 0 40px; text-align: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 22px;
}
.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.hero h1 .grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  margin: 18px auto 0;
  max-width: 620px;
  color: var(--text-muted);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
}

/* ------------------------------------------------------------- form card -- */
.shortener { margin-top: 38px; }
.form-card {
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.input-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.url-input-wrap { position: relative; flex: 1; }
.url-input-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.url-input {
  width: 100%;
  padding: 16px 16px 16px 46px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(7, 11, 20, 0.7);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.url-input::placeholder { color: var(--text-dim); }
.url-input:focus {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.98rem;
  border-radius: var(--radius-sm);
  padding: 16px 26px;
  color: #04121f;
  background: var(--gradient);
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.3);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn svg { flex-shrink: 0; }
.btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  box-shadow: none;
  padding: 14px 20px;
  font-size: 0.9rem;
}
.btn-ghost:hover { filter: none; background: var(--card-strong); color: var(--text); }

.form-error {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--danger);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
}
.form-error.show { display: flex; }

/* ------------------------------------------------------------ result card -- */
.result-card {
  display: none;
  margin-top: 14px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: left;
  animation: pop 0.3s ease;
}
.result-card.show { display: block; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
.result-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.result-label .check {
  display: grid;
  place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--success);
  color: #04121f;
}
.result-short {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 700;
  color: var(--accent);
  word-break: break-all;
  margin-bottom: 12px;
}
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.result-meta {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-top: 12px;
}

/* ------------------------------------------------------------- stats strip -- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 34px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 10px;
}
.stat b {
  display: block;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span { color: var(--text-dim); font-size: 0.78rem; font-weight: 600; }

/* -------------------------------------------------------------- ad slots -- */
.ad-zone {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 34px 0;
}
.ad-zone.ad-zone-interstitial { margin: 8px 0 24px; }
.ad-slot { max-width: 100%; }
.ad-slot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 110px;
  width: 100%;
  max-width: 728px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  text-align: center;
  padding: 16px;
}
.ad-slot-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.ad-slot-size { font-size: 0.75rem; }
.ad-slot-filled { min-height: 90px; display: flex; justify-content: center; align-items: flex-start; }

/* ----------------------------------------------------------- how it works -- */
.section { padding: 50px 0 10px; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 {
  font-size: clamp(1.45rem, 3.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.section-head p { color: var(--text-muted); margin-top: 8px; font-size: 0.95rem; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  transition: transform 0.2s, border-color 0.2s;
}
.step:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.step-num {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--gradient);
  color: #04121f;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 14px;
}
.step h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.01em; }
.step p { color: var(--text-muted); font-size: 0.88rem; }

/* -------------------------------------------------------------- features -- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.feature svg { color: var(--accent); margin-bottom: 12px; }
.feature h3 { font-size: 0.98rem; font-weight: 700; margin-bottom: 6px; }
.feature p { color: var(--text-muted); font-size: 0.86rem; }

/* ------------------------------------------------------------ recent links -- */
.links-list { display: grid; gap: 10px; }
.link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.link-item .short { color: var(--accent); font-weight: 700; font-size: 0.92rem; word-break: break-all; }
.link-item .target { color: var(--text-dim); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.link-item .clicks { color: var(--text-muted); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.empty-note { text-align: center; color: var(--text-dim); font-size: 0.9rem; padding: 24px 0; }

/* ------------------------------------------------------------------ faq -- */
.faq { display: grid; gap: 10px; max-width: 760px; margin: 0 auto; }
details.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  overflow: hidden;
}
details.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 0.95rem;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary .chev { color: var(--text-dim); transition: transform 0.2s; flex-shrink: 0; }
details[open] .chev { transform: rotate(180deg); }
details.faq-item .faq-body { padding: 0 18px 16px; color: var(--text-muted); font-size: 0.88rem; }

/* ---------------------------------------------------------------- footer -- */
footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  padding: 26px 0 30px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}
footer .f-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
footer a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
footer a:hover { color: var(--text); }

/* ============================================================ GO (countdown) page ============================================================ */

.go-wrap { min-height: 100dvh; display: flex; flex-direction: column; }
.go-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 20px;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}
.go-card {
  width: 100%;
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.go-card h1 { font-size: clamp(1.2rem, 3vw, 1.5rem); font-weight: 800; letter-spacing: -0.02em; }
.go-target {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.go-target b { color: var(--accent); font-weight: 700; }

.countdown { margin: 26px 0 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ring {
  position: relative;
  width: 128px; height: 128px;
}
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, 0.09); }
.ring .bar {
  stroke: url(#gradientStroke);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.ring-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.progress-track {
  width: 100%;
  max-width: 320px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  border-radius: 999px;
  transition: width 1s linear;
}
.go-status { color: var(--text-dim); font-size: 0.86rem; margin-top: 4px; }
.go-status.done { color: var(--success); font-weight: 700; }
.go-btn { display: none; margin-top: 18px; width: 100%; }
.go-btn.show { display: inline-flex; }
.go-note {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.go-error { color: var(--danger); font-weight: 700; padding: 30px 0; text-align: center; }

/* ================================================================ toast ================================================================ */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(248, 113, 113, 0.5); color: #fecaca; }

/* ========================================================== responsive ========================================================== */
@media (min-width: 640px) {
  .input-row { flex-direction: row; }
  .btn-shorten { padding: 16px 34px; }
  .go-card { padding: 36px 32px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .steps, .features { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .link-item .target { max-width: 100%; white-space: normal; }
  .hero { padding-top: 44px; }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}