/* Eddie: shared styles for the web pages. Colours match the iOS and Android apps. */

:root {
  --purple: #6b3fd4;
  --purple-dark: #5a32b8;
  --ink: #1a1530;
  --muted: #6e6a7c;
  --border: #e2dbf3;
  --surface: #ffffff;
  --page: #f7f5fc;
  --danger: #c62828;
  --success: #2e7d32;
  --radius: 16px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.45;
}

a { color: var(--purple); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Flash messages */
.flash {
  max-width: 440px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
}
.flash--alert { background: #fdecec; color: var(--danger); }
.flash--notice { background: #ecf6ee; color: var(--success); }

/* Centred white card used by sign-up, log-in and profile */
.page {
  display: flex;
  justify-content: center;
  padding: 32px 16px 48px;
}

.card {
  width: 100%;
  max-width: 440px;
  padding: 36px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(60, 30, 140, 0.06);
}

@media (max-width: 480px) {
  .page { padding: 0; }
  .card { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; padding: 32px 20px; }
}

.card__title { margin: 0 0 6px; font-size: 28px; font-weight: 800; text-align: center; }
.card__subtitle { margin: 0 0 8px; color: var(--muted); font-size: 17px; text-align: center; }
.card__header { margin-bottom: 24px; }
.card__footer { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 15px; }

.stack { display: flex; flex-direction: column; gap: 14px; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  border-radius: var(--radius);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.button:hover { text-decoration: none; }

.button--primary { color: #fff; background: var(--purple); border: 0; }
.button--primary:hover { background: var(--purple-dark); }

.button--outline { color: var(--ink); background: #fff; border: 1.5px solid var(--border); }
.button--outline:hover { background: #faf8ff; border-color: #cfc3ef; }
.button--outline svg { width: 20px; height: 20px; flex: none; }

/* button_to wraps the button in a form */
form.button_to { margin: 0; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 15px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 15px; font-weight: 500; }

.field__control {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 14px 0 16px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.15s;
}
.field__control:focus-within { border-color: var(--purple); }

.field__control input {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
}
.field__control input::placeholder { color: #a9a5b5; }

.field__icon, .field__toggle {
  display: inline-flex;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 4px;
  cursor: pointer;
}
.field__icon { cursor: default; }
.field__icon svg, .field__toggle svg { width: 22px; height: 22px; }

.forgot { align-self: flex-end; font-size: 15px; }

.errors {
  margin: 0;
  padding: 12px 16px;
  list-style: none;
  color: var(--danger);
  background: #fdecec;
  border-radius: 12px;
  font-size: 14px;
}

/* Profile photo picker */
.avatar-picker {
  position: relative;
  align-self: center;
  width: 132px;
  height: 132px;
  margin: 4px 0 8px;
  cursor: pointer;
}
.avatar-picker__image, .avatar-picker__placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
}
.avatar-picker__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(107, 63, 212, 0.45);
  background: #efeaf9;
}
.avatar-picker__placeholder svg { width: 64px; height: 64px; }
.avatar-picker__badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: var(--purple);
  border: 3px solid #fff;
  border-radius: 50%;
}
.avatar-picker__badge svg { width: 18px; height: 18px; }
.avatar-picker input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar-picker:focus-within .avatar-picker__image,
.avatar-picker:focus-within .avatar-picker__placeholder { outline: 3px solid rgba(107, 63, 212, 0.35); outline-offset: 2px; }

/* Welcome */
.welcome {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  color: #fff;
  background: #12062b url("/assets/welcome_background-f710ea40.jpg") center / cover no-repeat;
}
.welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.85) 85%);
}
.welcome__content {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}
.welcome__title { margin: 0 0 16px; font-size: clamp(38px, 7vw, 56px); font-weight: 800; line-height: 1.12; }
.welcome__lead { margin: 0 0 28px; font-size: 19px; color: rgba(255, 255, 255, 0.85); }
.welcome__login { margin: 16px 0 0; text-align: center; color: rgba(255, 255, 255, 0.8); }
.welcome__login a { color: #fff; }

/* Signed-in home */
.home { text-align: center; }
.home .avatar-picker__image, .home .avatar-picker__placeholder { width: 96px; height: 96px; margin: 0 auto 12px; }
.home__name { margin: 0; font-size: 24px; font-weight: 800; }
.home__meta { margin: 4px 0 0; color: var(--muted); }
.home form { margin-top: 24px; }

/* Trip onboarding: type, destination and dates */
.wizard__step { position: relative; display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; border: 0; min-width: 0; }
.wizard__step[hidden] { display: none; }
.wizard > .errors { margin-bottom: 16px; }
.wizard__back {
  position: absolute;
  top: -8px;
  left: -8px;
  display: inline-flex;
  padding: 8px;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.wizard__back:hover { background: #f3effc; }
.wizard__back svg { width: 22px; height: 22px; }
.wizard__step .card__header { margin-bottom: 4px; padding: 0 24px; }
.wizard__section { margin: 4px 0 0; font-size: 17px; font-weight: 700; }
.wizard__caption { margin: 0; color: var(--muted); text-align: center; }
.wizard__empty { margin: 0; padding: 12px 0; color: var(--muted); text-align: center; }

.kind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.kind-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 132px;
  padding: 16px 10px;
  text-align: center;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.kind-tile:hover { border-color: #cfc3ef; }
.kind-tile input { position: absolute; opacity: 0; pointer-events: none; }
.kind-tile__icon { display: flex; color: var(--purple); }
.kind-tile__icon svg { width: 36px; height: 36px; }
.kind-tile__label { font-weight: 600; font-size: 16px; }
.kind-tile:has(input:checked) { border: 2px solid var(--purple); background: #faf7ff; }
.kind-tile:has(input:focus-visible) { outline: 3px solid rgba(107, 63, 212, 0.35); outline-offset: 2px; }

.field__icon--leading { margin-right: 6px; padding-left: 0; }
.field__control input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

.destinations { display: flex; flex-direction: column; gap: 10px; }
.destinations[hidden], .destination[hidden] { display: none; }
.destination {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
}
.destination input { position: absolute; opacity: 0; pointer-events: none; }
.destination__thumb {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}
.destination__thumb--flag, .destination__thumb--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: #f3effc;
}
.destination__thumb--icon { color: var(--purple); }
.destination__thumb--icon svg { width: 26px; height: 26px; }
.destination__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.destination__name { font-weight: 600; }
.destination__detail { color: var(--muted); font-size: 14px; }
.destination__check { display: flex; color: var(--purple); visibility: hidden; }
.destination__check svg { width: 24px; height: 24px; }
.destination:has(input:checked) .destination__check { visibility: visible; }
.destination:has(input:focus-visible) { outline: 3px solid rgba(107, 63, 212, 0.35); outline-offset: 2px; }

.calendar { padding: 16px; border: 1.5px solid var(--border); border-radius: var(--radius); }
.calendar__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calendar__month { font-weight: 700; font-size: 17px; }
.calendar__nav { display: inline-flex; padding: 6px; color: var(--ink); background: none; border: 0; border-radius: 50%; cursor: pointer; }
.calendar__nav:hover { background: #f3effc; }
.calendar__nav svg { width: 20px; height: 20px; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; text-align: center; }
.calendar__weekday { padding: 6px 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.calendar__day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}
.calendar__day span { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; }
.calendar__day:hover:not(:disabled) span { background: #f3effc; }
.calendar__day:disabled { color: #c9c5d4; cursor: default; }
.calendar__day--between { background: #ece5fb; }
.calendar__day--start.calendar__day--edge { background: linear-gradient(to right, transparent 50%, #ece5fb 50%); }
.calendar__day--end.calendar__day--edge { background: linear-gradient(to left, transparent 50%, #ece5fb 50%); }
.calendar__day--start span, .calendar__day--end span,
.calendar__day--start:hover span, .calendar__day--end:hover span { color: #fff; font-weight: 700; background: var(--purple) !important; }

.date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.date-fields input[type="date"] { min-height: 22px; }
.date-fields input[type="date"]::-webkit-calendar-picker-indicator { display: none; }

.home__trips { margin: 20px 0 0; padding: 0; list-style: none; text-align: left; }
.home__trips li { padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 14px; }
.home__trips li + li { margin-top: 8px; }
.home__trips strong { display: block; }
