/* ============================================
   SLAY — Design Tokens
   ============================================ */
:root {
  --bg: #FFF9E8;
  --bg-secondary: #FFF4D6;
  --card: #FFF0BF;
  --primary: #F8C537;
  --accent: #FFB300;
  --text: #1E1E1E;
  --muted: #6B6B6B;
  --border: #E5D7A3;

  --shadow-out: 8px 8px 16px rgba(0,0,0,0.08), -8px -8px 16px rgba(255,255,255,0.9);
  --shadow-out-sm: 4px 4px 10px rgba(0,0,0,0.07), -4px -4px 10px rgba(255,255,255,0.85);
  --shadow-in: inset 4px 4px 8px rgba(0,0,0,0.08), inset -4px -4px 8px rgba(255,255,255,0.7);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 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.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.icon { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

/* ============================================
   Navigation
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 249, 232, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-out-sm);
}

.nav-logo-mark .icon { width: 17px; height: 17px; color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--card);
}

.nav-links a.nav-cta {
  color: var(--text);
  background: var(--primary);
  box-shadow: var(--shadow-out-sm);
}

.nav-links a.nav-cta:hover { background: var(--accent); }

/* ============================================
   Hero + Shortener
   ============================================ */
.hero {
  padding: 72px 0 56px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.hero p {
  font-size: 17px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
}

.shortener-card {
  max-width: 660px;
  margin: 40px auto 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-out);
  padding: 28px;
}

.shortener-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.field-group {
  position: relative;
  flex: 1;
}

.field-group.alias-group { flex: 0 0 200px; }

.field-group label {
  position: absolute;
  top: -9px;
  left: 14px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--card);
  padding: 0 6px;
}

.field-group input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-in);
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.field-group input::placeholder { color: #A8A08A; }

.field-group input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-in), 0 0 0 3px rgba(255, 179, 0, 0.18);
}

.btn-primary {
  height: 54px;
  padding: 0 26px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-out-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 10px 10px 18px rgba(0,0,0,0.1), -6px -6px 14px rgba(255,255,255,0.9);
}

.btn-primary:active { transform: translateY(0); }

.shortener-form-row { display: flex; gap: 12px; }
.shortener-form-row .btn-primary { flex: 0 0 auto; }

.form-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 10px;
  padding-left: 4px;
}

.form-error {
  font-size: 13px;
  font-weight: 600;
  color: #B3261E;
  margin-top: 10px;
  padding-left: 4px;
  display: none;
}

.form-error.show { display: block; }

/* Result card */
.result-card {
  margin-top: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-in);
  padding: 16px 18px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: resultIn 0.3s ease;
}

.result-card.show { display: flex; }

@keyframes resultIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.result-info .icon { color: var(--accent); }

.result-url {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  background: var(--primary);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-out-sm);
  transition: background 0.2s ease;
}

.btn-copy:hover { background: var(--accent); }
.btn-copy .icon { width: 15px; height: 15px; }

/* ============================================
   Features
   ============================================ */
.features {
  padding: 80px 0;
}

.section-head {
  text-align: center;
  max-width: 480px;
  margin: 0 auto 44px;
}

.section-head h2 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.section-head p { color: var(--muted); font-size: 15.5px; }

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

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-out);
  padding: 26px 22px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 12px 12px 22px rgba(0,0,0,0.1), -8px -8px 18px rgba(255,255,255,0.95);
}

.feature-icon {
  width: 46px;
  height: 46px;
  background: var(--bg-secondary);
  border-radius: 13px;
  box-shadow: var(--shadow-out-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.feature-icon .icon { color: var(--accent); width: 21px; height: 21px; }

.feature-card h3 {
  font-size: 16.5px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* ============================================
   Footer
   ============================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-text { font-size: 13px; color: var(--muted); }

.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--muted); font-weight: 600; }
.footer-links a:hover { color: var(--text); }

/* ============================================
   Auth (install / login)
   ============================================ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-out);
  padding: 36px 32px;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
  text-align: center;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-form label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: -6px;
}

.auth-form input {
  height: 50px;
  padding: 0 14px;
  font-size: 14.5px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-in);
  outline: none;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-in), 0 0 0 3px rgba(255, 179, 0, 0.18);
}

.auth-form .btn-primary { margin-top: 6px; }

.auth-msg {
  font-size: 13.5px;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  text-align: center;
}

.auth-msg.error { background: #FBE4E2; color: #B3261E; }
.auth-msg.success { background: #E3F3DE; color: #2C6E1F; }

/* ============================================
   Admin Dashboard
   ============================================ */
.admin-shell { min-height: 100vh; }

.admin-topbar {
  background: rgba(255, 249, 232, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.admin-main { padding: 36px 0 60px; }

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

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-out);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-out-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon .icon { color: var(--accent); width: 22px; height: 22px; }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }

.admin-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-out);
  overflow: hidden;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.admin-panel-head h2 { font-size: 17px; font-weight: 700; }

.search-box {
  position: relative;
  width: 260px;
}

.search-box .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  font-size: 13.5px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-in);
  outline: none;
}

.links-table { width: 100%; border-collapse: collapse; }

.links-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}

.links-table td {
  padding: 14px 24px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.links-table tr:last-child td { border-bottom: none; }

.link-alias { font-weight: 700; }

.link-long {
  color: var(--muted);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
}

.badge.active { background: #E3F3DE; color: #2C6E1F; }
.badge.inactive { background: #F0E9D2; color: var(--muted); }

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

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-out-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.btn-icon .icon { width: 15px; height: 15px; color: var(--muted); }
.btn-icon:hover { background: var(--primary); }
.btn-icon:hover .icon { color: var(--text); }
.btn-icon.danger:hover { background: #F3CFC9; }
.btn-icon.danger:hover .icon { color: #B3261E; }

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
  font-size: 14px;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.btn-logout:hover { color: var(--text); background: var(--card); }

/* ============================================
   404
   ============================================ */
.error-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.error-code {
  font-size: 96px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--primary);
  -webkit-text-stroke: 1.5px var(--accent);
}

.error-wrap h1 { font-size: 22px; font-weight: 700; margin: 8px 0 10px; }
.error-wrap p { color: var(--muted); margin-bottom: 26px; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 880px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-stats { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero h1 { font-size: 32px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .shortener-row, .shortener-form-row { flex-direction: column; }
  .field-group.alias-group { flex: 1; }
  .features-grid { grid-template-columns: 1fr; }
  .admin-panel-head { flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; }
  .links-table { display: block; overflow-x: auto; }
  footer .container { flex-direction: column; gap: 12px; text-align: center; }
}
