:root {
  --bg: #f6f9fc;
  --surface: #ffffff;
  --text: #0f2540;
  --muted: #64809c;
  --primary: #0a84d6;
  --primary-dark: #086bb0;
  --accent: #f4a24a;
  --border: #e3ecf4;
  --shadow: 0 10px 30px rgba(15, 37, 64, 0.08);
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, #eaf4fb 0%, var(--bg) 40%);
  min-height: 100vh;
}

.hero {
  text-align: center;
  padding: 4rem 1.5rem 2rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
}

.hero h1 span {
  color: var(--primary);
}

.hero p {
  color: var(--muted);
  margin-top: 0.75rem;
  font-size: 1.1rem;
  max-width: 520px;
  margin-inline: auto;
}

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.card-title {
  margin-bottom: 1.25rem;
  color: var(--primary);
  font-size: 1.2rem;
}

.save-origin-btn {
  width: auto;
  padding: 0.7rem 1.2rem;
}

.origin-wrap {
  position: relative;
}

.origin-wrap input {
  padding-right: 2.5rem;
}

.origin-status {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  transform: translateY(-50%);
  font-weight: 700;
  font-size: 1.1rem;
  pointer-events: none;
}

.origin-status.ok { color: #1b7a43; }
.origin-status.err { color: #c0392b; }
.origin-status.pending { color: var(--muted); }

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  list-style: none;
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}

.suggestions li {
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestions li:last-child { border-bottom: none; }
.suggestions li:hover { background: #eef4fa; }

input.is-verified {
  border-color: #1b7a43;
  box-shadow: 0 0 0 4px rgba(27, 122, 67, 0.12);
}

input.is-invalid {
  border-color: #c0392b;
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.12);
}

.hint {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.form-row {
  margin-bottom: 1.25rem;
}

#destinations {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dest-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.dest-row input.dest-input {
  flex: 1 1 60%;
}

.dest-row input.price-input {
  flex: 1 1 30%;
  min-width: 90px;
}

.remove-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  background: #fdeaea;
  color: #c0392b;
  font-size: 1.3rem;
  line-height: 1;
  border-radius: 10px;
}

.remove-btn:hover {
  background: #f9d4d4;
}

.add-btn {
  margin-top: 0.75rem;
  width: auto;
  padding: 0.6rem 1.1rem;
  background: transparent;
  color: var(--primary);
  border: 1px dashed var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.add-btn:hover {
  background: rgba(10, 132, 214, 0.08);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  background: #fbfdfe;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(10, 132, 214, 0.15);
}

button {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

button:hover {
  background: var(--primary-dark);
}

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

.feedback {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
}

.feedback.ok {
  background: #e6f6ec;
  color: #1b7a43;
}

.feedback.err {
  background: #fdeaea;
  color: #c0392b;
}

.section-title {
  margin: 2.5rem 0 1rem;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

ul#alerts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.alert-city {
  font-weight: 700;
  font-size: 1.1rem;
}

.alert-meta {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.prices-btn {
  width: auto;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  background: #eef4fa;
  color: var(--primary);
}

.prices-btn:hover { background: #dfeaf5; }

.prices-box {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  background: #fbfdfe;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.price-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.airline-list {
  list-style: none;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.airline-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0.6rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.airline { font-weight: 600; }
.airline-code { color: var(--muted); font-weight: 500; font-size: 0.8em; }
.airline-stops { color: var(--muted); font-size: 0.8em; margin-left: 0.35rem; }
.airline-price { color: var(--primary); font-weight: 700; }
.airline-date { color: var(--muted); font-weight: 500; font-size: 0.8em; }

.airline-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.airline-link:hover .airline-price {
  text-decoration: underline;
}

.airline-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.airline-details {
  color: var(--muted);
  font-size: 0.8em;
}

.airline-route {
  margin-left: 0.35rem;
}

.search-all { margin-top: 2rem; }

.range-row {
  display: flex;
  gap: 1rem;
}

.range-row .form-row { flex: 1; }

.search-all-btn {
  margin-top: 0.5rem;
}

.search-results {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-destination {
  background: #fbfdfe;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.result-header {
  margin-bottom: 0.5rem;
}

.result-city {
  font-weight: 700;
  font-size: 1.05rem;
}

.result-budget {
  color: var(--muted);
  font-size: 0.85rem;
}

.airline-list li.under-budget {
  border-color: #1b7a43;
  background: #f1faf4;
}

.budget-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: #e6f6ec;
  color: #1b7a43;
  font-size: 0.72rem;
  font-weight: 700;
}

.alert-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edit-btn,
.delete-btn,
.save-btn,
.cancel-btn {
  width: auto;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  background: #eef4fa;
  color: var(--primary);
}

.edit-btn:hover { background: #dfeaf5; }
.save-btn { background: var(--primary); color: #fff; }
.save-btn:hover { background: var(--primary-dark); }
.cancel-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.cancel-btn:hover { background: var(--border); }

.delete-btn {
  background: #fdeaea;
  color: #c0392b;
}

.delete-btn:hover { background: #f9d4d4; }

.alert-info .edit-dest,
.alert-info .edit-price {
  width: 100%;
  margin-bottom: 0.5rem;
}

.alert-info .edit-price { max-width: 140px; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0;
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  font-size: 0.85rem;
}
