/* ==========================================================
   MEMORABLE — shared components
   buttons · cards · forms · alerts
   ========================================================== */

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.25s var(--ease), border-color 0.25s, color 0.25s,
    transform 0.25s var(--ease), opacity 0.2s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--primary:hover {
  background: var(--accent-ink);
}
.btn--ghost {
  border-color: var(--line);
  color: var(--ink-soft);
  background: transparent;
}
.btn--ghost:hover {
  border-color: var(--accent-line);
  color: var(--accent-ink);
}
.btn--block {
  width: 100%;
}
.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}
.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: 0.9;
  animation: mem-spin 0.7s linear infinite;
  display: none;
}
.btn[aria-busy="true"] .btn-spinner {
  display: inline-block;
}
@keyframes mem-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn-spinner {
    animation: none;
  }
}

/* ---------- surfaces / panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ---------- feature / destination cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.4vw, 28px);
}
@media (max-width: 980px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}
.dest-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(22px, 3vw, 30px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  min-height: 100%;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}
.dest-card:hover,
.dest-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent-line);
}
.dest-card:active {
  transform: translateY(-1px);
}
.dest-card-art {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
}
.dest-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease);
}
.dest-card:hover .dest-card-art img {
  transform: scale(1.045);
}
.dest-card-index {
  position: absolute;
  left: 12px;
  top: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
}
.dest-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.dest-card-body .h3 {
  font-size: clamp(1.35rem, 0.9vw + 1.05rem, 1.7rem);
}
.dest-card-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}
.dest-card-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent-ink);
}
.dest-card-cta svg {
  width: 15px;
  height: 15px;
  transition: transform 0.3s var(--ease);
}
.dest-card:hover .dest-card-cta svg,
.dest-card:focus-visible .dest-card-cta svg {
  transform: translateX(4px);
}

/* ---------- forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.field .hint {
  font-size: 12.5px;
  color: var(--muted);
}
.input {
  width: 100%;
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.input::placeholder {
  color: var(--muted);
}
.input:focus {
  border-color: var(--accent-line);
  background: var(--surface);
}
.input[aria-invalid="true"] {
  border-color: var(--danger-line);
}
.field-error {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
}
.field-error.show {
  display: flex;
}
.field-error::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  flex: none;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 4px 0 22px;
}
.checkbox-row input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex: none;
}
.checkbox-row a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 22px;
}

/* ---------- alerts / banners ---------- */
.alert {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
}
.alert.show {
  display: flex;
}
.alert--error {
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger);
}
.alert--info {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
}

/* ---------- auth switch links ---------- */
.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 22px;
}
.auth-switch a {
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
}
.auth-switch a:hover {
  text-decoration: underline;
}
