/* ==========================================================================
   HY — design tokens
   Paleta: fundo quase-preto azulado + gradiente violeta→ciano como acento.
   Tipografia: Space Grotesk (títulos), Inter (texto), JetBrains Mono (links/dados).
   ========================================================================== */

:root {
  --bg: #000000;
  --surface: #131826;
  --surface-2: #1A2133;
  --border: #232B3F;
  --text: #E8EBF3;
  --text-muted: #8B93A9;
  --accent-1: #d1040b;
  --accent-2: #db3d43;
  --accent-gradient: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
  --danger: #F0596C;
  --success: #3ED7A0;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-glow: 0 0 0 1px rgba(124, 108, 240, 0.15), 0 20px 60px -20px rgba(124, 108, 240, 0.35);
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Fundo com dois brilhos suaves — o único momento "decorativo" da página */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px circle at 12% -5%, rgba(124, 108, 240, 0.25), transparent 60%),
    radial-gradient(500px circle at 90% 15%, rgba(0, 217, 200, 0.16), transparent 60%);
}

@media (prefers-reduced-motion: no-preference) {
  .bg-glow { animation: drift 18s ease-in-out infinite alternate; }
}
@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(24px); }
}

.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;
}

a { color: var(--accent-2); }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------- */
/* Header / footer                                                        */
/* ---------------------------------------------------------------------- */

.site-header {
  display: flex;
  justify-content: center;
  padding: 28px 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
  display: block;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.01em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 48px 20px 32px;
}

.site-footer a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--text); }

/* ---------------------------------------------------------------------- */
/* Layout principal                                                       */
/* ---------------------------------------------------------------------- */

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero {
  text-align: center;
  padding: 0 8px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.hero .muted {
  max-width: 46ch;
  margin: 0 auto;
}

.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }

/* ---------------------------------------------------------------------- */
/* Painel / cartão                                                        */
/* ---------------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  padding: 28px;
}

.panel--center {
  text-align: center;
}

.panel h1 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 8px;
}

.eyebrow-icon {
  font-size: 28px;
  margin: 0 0 8px;
}

/* ---------------------------------------------------------------------- */
/* Formulário                                                             */
/* ---------------------------------------------------------------------- */

.shorten-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field--url {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 4px 4px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field--url:focus-within {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(124, 108, 240, 0.18);
}

.field-icon {
  font-size: 16px;
  margin-right: 4px;
  opacity: 0.8;
}

.field--url input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 8px;
}

.field--url input::placeholder { color: var(--text-muted); }
.field--url input:focus { outline: none; }

.alias-row {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.alias-row:focus-within {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(0, 217, 200, 0.16);
}

.alias-prefix {
  padding: 12px 0 12px 14px;
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
}

.alias-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 12px 14px 12px 4px;
}

.alias-row input:focus { outline: none; }

.field--honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------------------------------------------------------------------- */
/* Botões                                                                  */
/* ---------------------------------------------------------------------- */

.btn {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent-gradient);
  color: #ffffff;
}

.btn--primary:hover { filter: brightness(1.08); }

.btn--success { background: var(--success) !important; color: #08090F; }

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  margin-top: 8px;
}

.btn--ghost:hover { border-color: var(--accent-1); }

/* ---------------------------------------------------------------------- */
/* Resultado                                                              */
/* ---------------------------------------------------------------------- */

.result {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--border);
}

.result-label {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.result-row {
  display: flex;
  gap: 8px;
}

.result-input {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent-2);
  font-size: 15px;
  padding: 12px 14px;
}

.btn--copy { flex-shrink: 0; }

.result-actions {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.link-action {
  font-size: 13px;
  text-decoration: none;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.link-action:hover { color: var(--accent-2); border-color: var(--accent-2); }

.result--error {
  color: var(--danger);
}

.qr-wrap {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qr-wrap #qr-code {
  background: #fff;
  padding: 10px;
  border-radius: var(--radius-sm);
  line-height: 0;
}

.qr-wrap .muted { font-size: 12px; }

/* ---------------------------------------------------------------------- */
/* Recursos (features)                                                    */
/* ---------------------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: left;
}

.feature-icon {
  font-size: 20px;
  display: inline-block;
  margin-bottom: 10px;
}

.feature h2 {
  font-family: var(--font-display);
  font-size: 15px;
  margin: 0 0 4px;
}

.feature p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ---------------------------------------------------------------------- */
/* Estatísticas                                                           */
/* ---------------------------------------------------------------------- */

.stats-code {
  font-family: var(--font-mono);
  color: var(--accent-2);
  font-size: 20px;
  margin: 0 0 4px;
}

.stats-target { margin: 0 0 20px; word-break: break-all; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-number--sm { font-size: 14px; -webkit-text-fill-color: var(--text); color: var(--text); background: none; }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------- */
/* Responsivo                                                              */
/* ---------------------------------------------------------------------- */

@media (max-width: 640px) {
  .panel { padding: 20px; border-radius: var(--radius-md); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .result-row { flex-direction: column; }
  .btn--copy { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .wrap { padding: 32px 14px 16px; }
  .hero h1 { font-size: 26px; }
}
