:root {
  color-scheme: light;
  --bg: #ffe6f6;
  --bg-strong: #ffd1f1;
  --ink: #241625;
  --muted: #5c4b62;
  --accent: #ff4fd8;
  --accent-2: #1ed6c1;
  --accent-3: #ffd74d;
  --card: rgba(255, 248, 255, 0.9);
  --card-border: rgba(36, 22, 37, 0.12);
  --danger: #e0353a;
  --shadow: 0 20px 45px rgba(36, 22, 37, 0.18);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, #fff5ff 0%, var(--bg) 45%, var(--bg-strong) 100%),
    repeating-linear-gradient(90deg, rgba(30, 214, 193, 0.08) 0 2px, rgba(30, 214, 193, 0) 2px 20px);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(36, 22, 37, 0.04) 0,
    rgba(36, 22, 37, 0.04) 1px,
    transparent 1px,
    transparent 6px
  );
  opacity: 0.35;
  z-index: 0;
}

h1, h2, h3 {
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  margin: 0 0 0.3rem 0;
  letter-spacing: 0.5px;
}

p {
  margin: 0;
}

.bg-orb,
.bg-sun,
.bg-grid {
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

.bg-orb {
  border-radius: 999px;
  opacity: 0.8;
  animation: float 12s ease-in-out infinite;
}

.orb-one {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(255, 79, 216, 0.35), rgba(255, 79, 216, 0));
  top: -120px;
  left: -80px;
}

.orb-two {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(30, 214, 193, 0.35), rgba(30, 214, 193, 0));
  bottom: -160px;
  right: -120px;
  animation-delay: -4s;
}

.bg-sun {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  top: -60px;
  right: 12%;
  background: radial-gradient(circle at 30% 30%, #fff2fb 0%, #ffb1ec 35%, rgba(255, 79, 216, 0.1) 70%);
  box-shadow: 0 0 80px rgba(255, 79, 216, 0.4);
  animation: glow 10s ease-in-out infinite;
}

.bg-grid {
  left: -20%;
  right: -20%;
  bottom: -160px;
  height: 55vh;
  transform: perspective(700px) rotateX(70deg);
  transform-origin: top;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(30, 214, 193, 0.18) 100%),
    repeating-linear-gradient(90deg, rgba(30, 214, 193, 0.35) 0 2px, transparent 2px 50px),
    repeating-linear-gradient(0deg, rgba(255, 79, 216, 0.2) 0 2px, transparent 2px 50px);
  opacity: 0.7;
}

.hero {
  padding: 48px 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.pin-button {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 6;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #ff4fd8, #7c2be3);
  box-shadow: 0 10px 20px rgba(124, 43, 227, 0.25);
  cursor: pointer;
}

.pin-button:active {
  transform: translateY(1px);
}

.hero-shell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeUp 0.8s ease-out;
}

.logo {
  width: clamp(200px, 40vw, 320px);
  height: clamp(200px, 40vw, 320px);
  filter: drop-shadow(0 28px 44px rgba(124, 43, 227, 0.5));
}

.location-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.layout {
  display: grid;
  gap: 20px;
  padding: 20px;
  width: min(1100px, 100%);
  max-width: 100%;
  margin: 0 auto 60px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  position: relative;
  z-index: 1;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  padding: 24px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.8s ease-out;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

input,
button {
  font-family: inherit;
}

input {
  border-radius: 14px;
  border: 1px solid rgba(36, 22, 37, 0.15);
  padding: 12px 14px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

#pin-input {
  font-size: 16px;
}

input:focus {
  outline: 2px solid rgba(255, 79, 216, 0.35);
  border-color: rgba(255, 79, 216, 0.35);
}

.input-error {
  border-color: var(--danger);
  outline: 2px solid rgba(224, 53, 58, 0.35);
  animation: shake 0.25s ease;
}

.primary {
  border: none;
  background: linear-gradient(135deg, var(--accent), #7c2be3);
  color: white;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px rgba(124, 43, 227, 0.25);
}

.primary:hover {
  transform: translateY(-2px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ghost {
  border: 1px solid rgba(36, 22, 37, 0.18);
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.ghost.danger {
  color: var(--danger);
  border-color: rgba(224, 53, 58, 0.4);
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 215, 77, 0.3);
  color: #7a4f00;
  font-weight: 600;
  font-size: 0.8rem;
}

.location-pill {
  background: linear-gradient(135deg, #ff4fd8, #7c2be3, #1ed6c1);
  color: #fff;
  text-shadow: 0 1px 6px rgba(36, 22, 37, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(80vw, 320px);
}

.form-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.search-results {
  display: grid;
  gap: 12px;
}

.result {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 79, 216, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.result:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(124, 43, 227, 0.18);
}

.result-title {
  font-size: 1rem;
}

.result-address,
.result-distance {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.places {
  display: grid;
  gap: 14px;
}

.place {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(124, 43, 227, 0.2);
  animation: fadeUp 0.5s ease-out;
}

.place-title {
  font-size: 1.1rem;
}

.place-meta,
.place-address {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.place-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 10, 32, 0.5);
  padding: 20px;
  z-index: 10;
}

.modal.active {
  display: flex;
}

.modal-card {
  background: var(--card);
  padding: 28px;
  border-radius: var(--radius);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 79, 216, 0.3);
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 500;
  margin: 12px 0;
}

.error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 8px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes glow {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

@media (max-width: 800px) {
  .card-head {
    flex-direction: column;
  }

  .place,
  .result {
    grid-template-columns: 1fr;
  }

  .place-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  body {
    line-height: 1.5;
  }

  .hero {
    padding: 32px 14px 6px;
  }

  h2 {
    font-size: 1.2rem;
  }

  .logo {
    width: 220px;
    height: 220px;
  }

  .layout {
    padding: 12px;
    grid-template-columns: 1fr;
  }

  .card {
    padding: 18px;
  }

  input {
    font-size: 16px;
  }

  .place-meta,
  .place-address,
  .result-address,
  .result-distance {
    font-size: 0.8rem;
  }

  .pill {
    font-size: 0.75rem;
  }
}

@supports (-webkit-touch-callout: none) {
  input,
  textarea,
  select {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
