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

:root {
  --primary: #6C47FF;
  --primary-dark: #5535e0;
  --primary-light: #ede9ff;
  --accent: #FF6B6B;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #0a0a0f;
  --bg2: #111118;
  --card: #16161f;
  --card-border: #2a2a3a;
  --text: #f0f0f8;
  --text-muted: #8888a8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 40px rgba(108,71,255,0.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(108,71,255,0.25) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(255,107,107,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ── Header ── */
.header {
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: relative;
  z-index: 10;
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
}
.logo strong { color: var(--primary); }
.logo-icon { font-size: 1.2rem; }
.btn-admin {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  transition: all 0.2s;
}
.btn-admin:hover { color: var(--text); border-color: var(--primary); background: rgba(108,71,255,0.1); }

/* ── Main ── */
.main { flex: 1; padding: 60px 0 40px; }

.hero { text-align: center; margin-bottom: 40px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(108,71,255,0.1);
  border: 1px solid rgba(108,71,255,0.25);
  border-radius: 20px;
  padding: 5px 14px;
  margin-bottom: 20px;
  letter-spacing: 0.03em;
}
.badge-dot {
  width: 7px; height: 7px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.highlight {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.url-demo {
  font-family: monospace;
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  letter-spacing: -0.5px;
}
#demoSlug {
  border-bottom: 2px solid rgba(108,71,255,0.5);
  padding-bottom: 1px;
}
.subtitle { color: var(--text-muted); font-size: 1rem; max-width: 500px; margin: 0 auto; line-height: 1.6; }

/* ── Como funciona ── */
.how-it-works { margin: 36px 0 0; }
.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  flex: 1;
  min-width: 160px;
}
.step-num {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-text { display: flex; flex-direction: column; gap: 2px; }
.step-text strong { font-size: 0.88rem; font-weight: 700; }
.step-text span { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.step-text code {
  font-family: monospace;
  color: var(--primary);
  font-size: 0.8rem;
  background: rgba(108,71,255,0.1);
  padding: 1px 4px;
  border-radius: 4px;
}
.step-arrow { color: var(--text-muted); font-size: 1.2rem; flex-shrink: 0; }

/* ── Card ── */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}

/* ── Form ── */
.field-group { margin-bottom: 22px; }
.field-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.label-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--primary);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  font-size: 1rem;
  pointer-events: none;
}

input[type="text"],
input[type="password"],
input[type="url"] {
  width: 100%;
  background: var(--bg2);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  padding: 13px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="url"]::placeholder { color: var(--text-muted); }
input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,71,255,0.15);
}
input.valid { border-color: var(--success); }
input.invalid { border-color: var(--danger); }

/* ── Slug row ── */
.slug-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.slug-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,71,255,0.15);
}
.slug-input-wrap.valid { border-color: var(--success); }
.slug-input-wrap.invalid { border-color: var(--danger); }

.slug-prefix {
  padding: 13px 12px 13px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  background: rgba(255,255,255,0.03);
  border-right: 1px solid var(--card-border);
  user-select: none;
}
.slug-input-wrap input {
  border: none;
  border-radius: 0;
  background: transparent;
  flex: 1;
  padding: 13px 12px;
}
.slug-input-wrap input:focus { box-shadow: none; }

.slug-status {
  padding: 0 14px;
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}
.slug-status.available { color: var(--success); }
.slug-status.taken { color: var(--danger); }
.slug-status.checking { color: var(--text-muted); }

/* ── Suggestions ── */
.suggestions-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.suggestions-label { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.suggestions-list { display: flex; gap: 8px; flex-wrap: wrap; }
.suggestion-chip {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  background: rgba(108,71,255,0.12);
  color: var(--primary);
  border: 1px solid rgba(108,71,255,0.3);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.suggestion-chip:hover {
  background: rgba(108,71,255,0.25);
  border-color: var(--primary);
}

/* ── Submit button ── */
.btn-submit {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 20px rgba(108,71,255,0.4);
  margin-top: 4px;
}
.btn-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(108,71,255,0.5); }
.btn-submit:active:not(:disabled) { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-arrow { font-size: 1.1rem; transition: transform 0.2s; }
.btn-submit:hover .btn-arrow { transform: translateX(4px); }

/* ── Result ── */
.result { margin-top: 24px; border-top: 1px solid var(--card-border); padding-top: 24px; }
.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.result-link-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 10px;
}
.result-link {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}
.result-link:hover { text-decoration: underline; }
.btn-copy {
  background: rgba(108,71,255,0.1);
  border: 1px solid rgba(108,71,255,0.3);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-copy:hover { background: rgba(108,71,255,0.25); }
.result-original {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 16px;
}
.btn-new {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 1px solid rgba(108,71,255,0.3);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-new:hover { background: rgba(108,71,255,0.1); }

/* ── Features ── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
}
.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  background: rgba(108,71,255,0.12);
  border: 1px solid rgba(108,71,255,0.25);
  border-radius: 12px;
  color: var(--primary);
}
.feature h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.feature p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* ── Footer ── */
.footer { padding: 24px 0; border-top: 1px solid rgba(255,255,255,0.05); text-align: center; }
.footer p { font-size: 0.82rem; color: var(--text-muted); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  z-index: 1000;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* ── 404 ── */
.page-404 { text-align: center; padding: 80px 0; }
.page-404 .code-404 { font-size: 6rem; font-weight: 800; color: var(--primary); opacity: 0.3; line-height: 1; }
.page-404 h2 { font-size: 1.5rem; margin: 16px 0 8px; }
.page-404 p { color: var(--text-muted); margin-bottom: 24px; }
.btn-home {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform 0.15s;
}
.btn-home:hover { transform: translateY(-2px); }

/* ── Admin ── */
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 61px); gap: 0; }
.sidebar {
  background: var(--card);
  border-right: 1px solid var(--card-border);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: calc(100vh - 61px);
  overflow-y: auto;
}
.sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 20px 10px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--text);
  background: rgba(108,71,255,0.08);
  border-left-color: var(--primary);
}

.admin-content { padding: 32px; overflow-y: auto; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-section h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.admin-section .section-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }

/* Admin login */
.login-wrap {
  max-width: 380px;
  margin: 80px auto;
}
.login-wrap h2 { text-align: center; margin-bottom: 6px; }
.login-wrap p { text-align: center; color: var(--text-muted); margin-bottom: 28px; font-size: 0.9rem; }

/* Admin form */
.admin-form .field-group { margin-bottom: 18px; }
.admin-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.btn-primary {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 16px rgba(108,71,255,0.35);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary.full { width: 100%; }

/* Upload area */
.upload-area {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(108,71,255,0.02);
  margin-bottom: 20px;
}
.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(108,71,255,0.06);
}
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-area h3 { font-size: 1.05rem; margin-bottom: 6px; }
.upload-area p { font-size: 0.85rem; color: var(--text-muted); }
.upload-area input[type="file"] { display: none; }
.file-selected {
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

/* Links table */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
}
tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); transition: background 0.1s; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody td { padding: 12px 16px; vertical-align: middle; }
.td-slug { font-weight: 700; color: var(--primary); }
.td-type {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}
.type-url { background: rgba(108,71,255,0.15); color: var(--primary); }
.type-file { background: rgba(34,197,94,0.15); color: var(--success); }
.td-target { color: var(--text-muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-clicks { font-weight: 600; }
.btn-delete {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-delete:hover { background: rgba(239,68,68,0.25); }

.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.search-bar {
  margin-bottom: 20px;
  position: relative;
}
.search-bar input { padding-left: 40px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* Responsive */
@media (max-width: 640px) {
  .features { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-bar { grid-template-columns: 1fr; }
  .slug-prefix { display: none; }
  .steps { flex-direction: column; gap: 8px; }
  .step-arrow { transform: rotate(90deg); }
  .step { width: 100%; }
  .hero-badge { font-size: 0.72rem; }
}
