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

:root {
  --accent:       #4F46E5;
  --accent-light: #EEF2FF;
  --accent-dark:  #3730A3;
  --success:      #10B981;
  --danger:       #EF4444;
  --ink:          #111827;
  --ink-soft:     #6B7280;
  --ink-muted:    #9CA3AF;
  --border:       #E5E7EB;
  --bg:           #F9FAFB;
  --card-bg:      #FFFFFF;
  --radius:       12px;
  --radius-lg:    18px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.site-header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-icon { font-size: 22px; }
.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}

/* ── Main ── */
main { flex: 1; }

/* ── Search section ── */
.search-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 24px 40px;
  transition: padding 0.3s ease;
}
.search-section.compact {
  padding-top: 32px;
}
.search-hero {
  text-align: center;
  margin-bottom: 40px;
  transition: opacity 0.3s;
}
.search-hero.hidden {
  display: none;
}
h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--ink);
  margin-bottom: 14px;
}
.subtitle {
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ── Form ── */
.search-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.optional {
  font-weight: 400;
  color: var(--ink-muted);
  text-transform: none;
  letter-spacing: 0;
}
textarea, input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  transition: border-color 0.15s;
  resize: none;
  outline: none;
}
textarea:focus, input[type="text"]:focus {
  border-color: var(--accent);
  background: #fff;
}
textarea { line-height: 1.5; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }

.btn-outline {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--border);
}
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
  width: 100%;
}

.btn-buy {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  flex-shrink: 0;
}
.btn-buy:hover { background: var(--accent); color: #fff; }

/* ── Results section ── */
.results-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 120px;
}
.results-header {
  padding: 32px 0 20px;
}
.results-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}
.results-meta {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* ── Cards grid ── */
.cards-grid, .skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.skeleton-grid[hidden] { display: none; }

/* ── Domain card ── */
.domain-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.domain-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(79,70,229,0.1);
}
.domain-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 4px 20px rgba(79,70,229,0.15);
}

.card-checkbox-wrap { position: relative; flex-shrink: 0; }
.card-checkbox {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.checkmark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: #fff;
  transition: all 0.15s;
  flex-shrink: 0;
}
.domain-card.selected .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}
.domain-card.selected .checkmark::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.card-body { flex: 1; min-width: 0; }
.card-domain {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-name { color: var(--ink); }
.card-tld  { color: var(--ink-muted); }
.domain-card.selected .card-name,
.domain-card.selected .card-tld { color: var(--accent-dark); }

.card-price {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* ── Skeleton ── */
.skeleton-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-line.wide   { width: 75%; height: 20px; }
.skeleton-line.medium { width: 45%; }
.skeleton-line.narrow { width: 30%; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Action bar ── */
.action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  z-index: 100;
  max-width: calc(100vw - 32px);
  flex-wrap: wrap;
}
.selected-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.action-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wrong-direction-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wrong-note-input {
  width: 200px;
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s, width 0.3s;
}
.wrong-note-input:focus { border-color: var(--accent); background: #fff; }
@media (max-width: 600px) {
  .wrong-note-input { width: 130px; }
}

/* ── Footer ── */
.site-footer {
  padding: 20px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--ink-muted); }

/* ── No results ── */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-soft);
}
.no-results p { font-size: 16px; margin-bottom: 8px; }
.no-results small { color: var(--ink-muted); }
