:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #141824;
  --muted: #5c6478;
  --border: #e4e7f0;
  --accent: #1c64f2;
  --accent-soft: #e8f0ff;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(20, 24, 36, 0.08);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

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

.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 28, 0.44);
  backdrop-filter: blur(5px);
  z-index: 90;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: auto;
  max-height: 70vh;
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid rgba(228, 231, 240, 0.8);
  z-index: 95;
  padding: 0;
  box-shadow: 0 18px 50px rgba(20, 24, 36, 0.16);
  overflow-y: auto;
  border-radius: 0 0 18px 18px;
  transform-origin: top;
  animation: drawerDrop 160ms ease-out;
}

.drawer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 1.25rem;
}

.drawer-handle {
  width: 3rem;
  height: 0.3rem;
  border-radius: 999px;
  background: #e6e9f2;
  margin: 0.25rem auto 0.6rem;
}

.drawer-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0 0.65rem;
  border-bottom: 1px solid rgba(228, 231, 240, 0.8);
}

.drawer-hint {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.drawer-filters {
  padding: 0.9rem 0 0;
  border-top: none;
}

.drawer-close-btn {
  width: 2.25rem;
  height: 2.25rem;
  background: #fafbff;
}

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

.nav {
  display: flex;
  gap: 1.25rem;
}

.nav a {
  color: var(--muted);
  font-weight: 500;
}

.nav a.active {
  color: var(--text);
}

.site-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero {
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.filter-details.panel {
  padding: 0;
}

.filter-summary {
  list-style: none;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  user-select: none;
}

.filter-summary::-webkit-details-marker {
  display: none;
}

.filter-summary::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.filter-details[open] .filter-summary::after {
  transform: rotate(-135deg);
  margin-top: 0.25rem;
}

.filter-summary-hint {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-details .filters {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

.filters {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.field label,
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field input[type="search"],
.field select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fafbff;
  font: inherit;
}

.doc-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.doc-checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 560px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.card-country {
  min-height: 0;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-clickable {
  position: relative;
}

.card-clickable:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-hit-area {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.card-hit-area:focus {
  outline: none;
}

.card-hit-area:hover ~ .card-image,
.card-hit-area:focus-visible ~ .card-image {
  filter: brightness(0.97);
}

.card-clickable .card-image,
.card-clickable .card-top,
.card-clickable .meta {
  position: relative;
  z-index: 0;
}

.card-actions-interactive {
  position: relative;
  z-index: 2;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.flag {
  font-size: 2rem;
  line-height: 1;
}

.card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.card-image {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.card-top,
.meta,
.card-actions,
.card-options {
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}

.card-top {
  padding-top: 0.35rem;
}

.card-actions {
  padding-bottom: 1.1rem;
}

.card-options {
  margin-top: auto;
  padding-bottom: 1.1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: grid;
  gap: 0.25rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge.evisa {
  background: var(--accent-soft);
  color: #173fad;
}

.badge.sticker {
  background: #fff6e5;
  color: #8a5a00;
}

.badge.none {
  background: #e8f7ef;
  color: #1b6b3b;
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.pill {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: #f1f3fa;
  font-size: 0.8rem;
  color: var(--muted);
}

.notice {
  background: #fff8e6;
  border: 1px solid #ffe0a3;
  color: #6a4b00;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.error-box {
  background: #fff0f0;
  border: 1px solid #ffc9c9;
  color: #7a1e1e;
  padding: 1rem;
  border-radius: 12px;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
  height: clamp(160px, 28vw, 280px);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #0d1b2a;
}

.detail-hero .flag {
  font-size: 3rem;
  line-height: 1;
}

.detail-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 10, 20, 0.18) 5%, rgba(5, 10, 20, 0.74) 100%);
}

.detail-hero-overlay {
  position: absolute;
  inset: auto 1rem 1rem;
  z-index: 1;
  display: flex;
  gap: 0.9rem;
  align-items: center;
  color: #fff;
}

.detail-hero h1 {
  margin: 0 0 0.35rem;
  color: inherit;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.detail-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.route-picker {
  display: grid;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 640px) {
  .route-picker {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
  }
}

.route-picker-actions {
  display: flex;
  align-items: flex-end;
}

.route-guidance {
  margin-top: 0;
}

.detail-options {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 900px) {
  .detail-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.option-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: #fafbff;
}

.muted {
  color: var(--muted);
  margin-top: 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.5rem 1.25rem 2rem;
}

.footer-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.site-footer h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin: 0.35rem 0;
}

.legal {
  max-width: 1120px;
  margin: 2rem auto 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-auth-links {
  margin: 0;
  font-size: 0.95rem;
}

.footer-auth-form {
  margin: 0;
}

.muted-sep {
  color: var(--muted);
  padding: 0 0.35rem;
}

body:has(.traveler-modal-overlay) {
  overflow: hidden;
}

.traveler-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 18, 28, 0.55);
  backdrop-filter: blur(4px);
}

.traveler-modal {
  width: min(100%, 32rem);
  max-height: min(90vh, 38rem);
  overflow-y: auto;
  margin: 0;
}

.traveler-modal-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.traveler-modal-lead {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.traveler-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.15rem;
}

.traveler-legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.flag-option-grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.6rem;
}

.flag-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fafbff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}

.flag-option:hover {
  border-color: var(--accent);
}

.flag-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.flag-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.flag-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}

.flag-option-img {
  display: block;
  width: 40px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.flag-option-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 30px;
  border-radius: 4px;
  background: var(--border);
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}

.flag-option-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.traveler-modal-actions {
  margin-top: 0.25rem;
  display: flex;
  justify-content: flex-end;
}

.profile-fav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.profile-fav-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
}

.btn.danger {
  background: #b91c1c;
  color: #fff;
  border: none;
}

.fav-form {
  display: inline;
  margin: 0;
}

.fav-form .btn {
  min-height: 2.25rem;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-form .field,
.admin-form textarea {
  max-width: 40rem;
}

.option-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--surface);
}

.option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.option-section {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--border);
}

.option-section-title {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.option-grid {
  display: grid;
  gap: 0.8rem;
}

@media (min-width: 760px) {
  .option-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .option-grid.three-col {
    grid-template-columns: 1fr 1fr 0.8fr;
  }
}

.inline-form {
  display: inline;
  margin-left: 0.35rem;
}

.inline-form .btn {
  margin: 0;
}

.admin-login {
  max-width: 24rem;
}

.auth-panel {
  max-width: 30rem;
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fafbff;
  font: inherit;
}
