:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1a1d29;
  --muted: #667085;
  --border: #e3e6ee;
  --accent: #2f5eff;
  --accent-hover: #2249d6;
  --accent-disabled: #a9bbfb;
  --warn-bg: #fff8e8;
  --warn-border: #f0c14b;
  --warn-text: #7a5b00;
  --success-bg: #eafaf0;
  --success-border: #34a853;
  --success-text: #17703a;
  --error-bg: #fdecea;
  --error-border: #e5534b;
  --error-text: #a8342c;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.page {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  width: 100%;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.08);
  padding: 2rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: #eef1ff;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 1.35rem;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}

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

.card-header h1 { margin: 0; }

.link-btn {
  width: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  text-decoration: underline;
  cursor: pointer;
}

.subtitle {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.warning {
  display: flex;
  gap: 0.6rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.warning .icon { flex-shrink: 0; font-size: 1rem; line-height: 1.5; }

code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.85em;
}

.field { margin-bottom: 1.1rem; }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 94, 255, 0.12);
}

.input-with-toggle {
  position: relative;
}

.input-with-toggle input {
  padding-right: 3.5rem;
}

.toggle-visibility {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  width: auto;
  margin-top: 0;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  border: none;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.checkbox-field input { width: auto; margin: 0; cursor: pointer; }

.fine-print {
  margin-top: 0.6rem;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--muted);
}

button {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { background: var(--accent-disabled); cursor: not-allowed; }

/* Compound selector so this reliably beats button:hover:not(:disabled) above
   (same specificity, later in source wins) instead of inheriting its blue
   fill + white text on hover/focus. */
button.toggle-visibility:hover,
button.toggle-visibility:focus-visible {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

/* Same specificity fix as above, for the plain-text "Sign out" link button. */
button.link-btn:hover,
button.link-btn:focus-visible {
  background: transparent;
  color: var(--text);
}

#result {
  margin-top: 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  display: none;
}

#result.success { display: block; background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-text); }
#result.error { display: block; background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error-text); }

.result-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.85;
}

#flights-result { margin-top: 1rem; font-size: 0.88rem; }
#flights-result .status { color: var(--muted); }
#flights-result .status.error { color: var(--error-text); }

.flights-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.flights-table th,
.flights-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.flights-table th { color: var(--muted); font-weight: 600; }

footer {
  margin-top: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}
