/* Monster Travel — interactive rebuild. Portfolio prototype by Felipe Herrera. */

:root {
  --blue: #0B63B5;        /* primary, 6.06:1 with white */
  --blue-soft: #E3F0FC;
  --orange: #B34700;      /* search button, 5.50:1 with white */
  --purple: #7B3FB8;
  --red: #C62828;         /* price tags, 5.62:1 with white */
  --green: #1B7A43;
  --ink: #1E2433;
  --muted: #5A6275;       /* 6.11:1 on white, 5.60:1 on --bg */
  --line: #DCE1EA;
  --bg: #F3F5F9;
  --danger: #B3261E;
  --sun: #FFE08A;
  --radius: 16px;
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: #E4E9F1; color: var(--ink); font-size: 16px; line-height: 1.45; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
::placeholder { color: var(--muted); opacity: 1; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 300; background: var(--blue); color: #fff; padding: 10px 14px; border-radius: 8px; font-weight: 800; }
.skip-link:focus { top: 12px; color: #fff; }
.noscript { margin: 0; padding: 16px; background: #FEF3C7; color: #92400E; font-weight: 700; }

/* ---------- Portfolio bar (not part of the app) ---------- */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 24px; background: #14161B; color: #fff; font-size: 13px; }
.demo-bar a { color: #fff; font-weight: 700; }
.demo-bar__back { text-decoration: none; }
.demo-bar__back:hover { text-decoration: underline; }
.demo-bar__label { color: #C9CDD6; }
.demo-bar :focus-visible { outline-color: #fff; }
.demo-guide { margin-left: auto; }
.demo-guide summary { cursor: pointer; font-weight: 800; color: #F5B301; min-height: 24px; }
.demo-guide__body { margin-top: 8px; padding: 12px 14px; border-radius: 8px; background: #262A33; max-width: 640px; }
.demo-guide__body p { margin: 0 0 6px; line-height: 1.6; }
.demo-guide__body p:last-child { margin-bottom: 0; }
.demo-guide__body button { background: none; border: 0; padding: 0; color: #F5B301; font-weight: 800; text-decoration: underline; min-height: 24px; }

/* ---------- The phone ---------- */
.phone {
  position: relative; display: flex; flex-direction: column;
  width: 100%; max-width: 420px; min-height: calc(100vh - 80px); margin: 20px auto;
  background: var(--bg); border-radius: 32px; overflow: hidden; box-shadow: 0 20px 50px rgba(20, 30, 60, .18);
}
.view { flex: 1; padding: 20px 20px 24px; }
.view:focus { outline: none; }
.offline-banner { margin: 0; padding: 10px 20px; background: var(--sun); color: var(--ink); font-weight: 800; font-size: 14px; }

.tabbar { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 60px; padding: 8px 4px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 800; }
.tabbar a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 3px 0 var(--blue); }
.tabbar :focus-visible { outline-offset: -4px; }

/* ---------- Common ---------- */
h1, h2, h3 { line-height: 1.2; margin: 0; }
.screen-title { font-size: 20px; font-weight: 900; text-align: center; }
.appbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin: -8px -8px 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); }
.icon-btn:hover { background: rgba(0,0,0,.05); }
.card { background: #fff; border-radius: var(--radius); box-shadow: 0 4px 14px rgba(20, 30, 60, .07); }
.section-h { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 12px; font-size: 18px; font-weight: 900; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 1px solid transparent; border-radius: 14px; font-weight: 900; text-decoration: none; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--search { background: var(--orange); color: #fff; font-size: 18px; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; }
.link-btn { min-height: 44px; padding: 0; border: 0; background: none; color: var(--blue); font-weight: 800; text-decoration: underline; }
.link-btn--danger { color: var(--danger); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 800; }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }

.field { margin: 0 0 16px; }
.field > label, .field > .label { display: block; margin: 0 0 6px; font-weight: 800; }
.field input, .field select {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid #737B8F; border-radius: 12px; background: #fff;
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border: 2px solid var(--danger); }
.field__error { margin: 6px 0 0; color: var(--danger); font-weight: 800; font-size: 14px; }
.field__help { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.alert { display: block; padding: 12px 14px; margin: 0 0 16px; border-radius: 12px; background: #FDECEA; color: var(--danger); font-weight: 800; }
.alert--info { background: var(--sun); color: var(--ink); }

.stepper-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.stepper-row:first-of-type { border-top: 0; }
.stepper-row .lbl { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 20px; font-weight: 900; }
.stepper output { min-width: 32px; text-align: center; font-weight: 900; }

/* ---------- Home ---------- */
.hello { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; }
.hello h1 { font-size: 28px; font-weight: 900; }
.avatar-btn { display: grid; place-items: center; width: 64px; height: 64px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: var(--blue-soft); box-shadow: 0 4px 12px rgba(20,30,60,.15); overflow: hidden; }
.avatar-btn { overflow: hidden; }
.search-box { position: relative; }
.search-box input { width: 100%; height: 52px; padding: 0 16px 0 48px; border: 1px solid #737B8F; border-radius: 14px; background: #fff; box-shadow: 0 4px 14px rgba(20,30,60,.07); }
.search-box svg { position: absolute; left: 16px; top: 15px; color: var(--muted); pointer-events: none; }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0 4px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--ink); font-weight: 800; font-size: 14px; text-decoration: none; }
.cat__icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; color: #fff; }
.dest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dest { display: block; padding: 0; border: 0; text-align: left; overflow: hidden; color: var(--ink); text-decoration: none; }
.dest__img { display: block; height: 96px; }
.dest__img svg { display: block; width: 100%; height: 100%; }
.dest__body { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; padding: 10px 12px 12px; }
.dest__body strong { display: block; font-size: 16px; }
.dest__body small { color: var(--muted); font-size: 13px; }
.price-tag { padding: 3px 8px; border-radius: 8px; background: var(--red); color: #fff; font-weight: 900; font-size: 14px; white-space: nowrap; }
.next-trip { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.next-trip strong { display: block; font-size: 17px; }

/* ---------- Flights ---------- */
.route { display: grid; grid-template-columns: 1fr 44px; grid-template-areas: "from swap" "to swap"; gap: 12px 10px; align-items: end; }
.route .field:first-child { grid-area: from; } .route .field:last-child { grid-area: to; } .route .swap { grid-area: swap; align-self: center; margin-top: 26px; }
.route .field { margin: 0; }
.swap { margin-bottom: 2px; border: 1px solid var(--line); background: #fff; }
.results-head { text-align: center; margin: -4px 0 14px; }
.results-head h1 { font-size: 22px; font-weight: 900; }
.flight { display: block; width: 100%; padding: 14px 16px; margin: 0 0 12px; border: 0; text-align: left; color: var(--ink); text-decoration: none; }
.flight__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.airline { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.airline__dot { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 900; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 900; background: var(--blue-soft); color: var(--blue); }
.badge--green { background: #DDF3E6; color: var(--green); }
.times { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.times strong { font-size: 20px; font-weight: 900; }
.times .code { display: block; color: var(--muted); font-size: 14px; font-weight: 700; }
.times .line { text-align: center; font-size: 13px; color: var(--muted); font-weight: 700; border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.flight__price { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; }
.flight__price strong { font-size: 22px; font-weight: 900; }
.empty { padding: 28px 20px; text-align: center; }
.empty h2 { font-size: 19px; margin: 12px 0 6px; }
.empty p { color: var(--muted); margin: 0 0 14px; }

.seg { padding: 16px; margin: 0 0 12px; }
.seg h3 { font-size: 15px; margin: 0 0 10px; }
.layover { margin: -4px 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 14px; text-align: center; }
.amenities { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.amenities li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bg); font-size: 13px; font-weight: 700; }
.summary { padding: 16px; margin: 0 0 16px; }
.summary dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 800; text-align: right; }
.summary .total { padding-top: 8px; border-top: 1px solid var(--line); font-size: 18px; color: var(--ink); }
.map { display: block; width: 100%; height: auto; border-radius: var(--radius) var(--radius) 0 0; background: #CFE6F7; }
.offline-ok { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #DDF3E6; color: var(--green); font-weight: 900; font-size: 13px; }

/* ---------- Trips ---------- */
.trip-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin: 0 0 12px; color: var(--ink); text-decoration: none; }
.trip-card strong { display: block; font-size: 17px; }
.friends-head { padding: 16px; margin: 0 0 16px; text-align: center; }
.faces { display: flex; justify-content: center; gap: 4px; margin: 0 0 10px; }
.face { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--blue-soft); border: 3px solid #fff; overflow: hidden; }

.face--pending { background: var(--bg); border: 3px dashed #737B8F; color: var(--muted); font-weight: 900; font-size: 13px; }
.friends-head h1 { font-size: 22px; font-weight: 900; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 80px; top: 8px; bottom: 8px; width: 3px; background: #7ED3A0; border-radius: 2px; }
.day-h { margin: 16px 0 8px; font-size: 15px; font-weight: 900; color: var(--muted); }
.plan { position: relative; display: grid; grid-template-columns: 72px 1fr; gap: 20px; align-items: start; margin: 0 0 12px; }
.plan__time { padding-top: 12px; font-weight: 900; font-size: 14px; text-align: right; white-space: nowrap; }
.plan__time::after { content: ''; position: absolute; left: 74px; top: 14px; width: 15px; height: 15px; border-radius: 50%; background: var(--purple); border: 3px solid var(--bg); }
.plan__card { padding: 12px 14px; }
.plan__card strong { display: block; }
.invites { list-style: none; padding: 0; margin: 8px 0 0; }
.invites li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-weight: 700; }

/* ---------- Monster Editor ---------- */
.stage { display: grid; place-items: center; padding: 18px 0 14px; margin: 0 0 12px; }
.monster { display: block; width: auto; }
.opt-title { font-size: 16px; font-weight: 900; margin: 0 0 12px; }
.parts { padding: 14px; }
.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opt { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-height: 104px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: 13px; font-weight: 800; }
.opt[aria-checked="true"] { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.opt img { flex: none; }
.avatar-btn img, .face img { margin: 0; }
.editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ---------- Dialogs & toast ---------- */
.dialog { width: min(400px, calc(100vw - 32px)); padding: 22px; border: 0; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); }
.dialog::backdrop { background: rgba(20,22,27,.55); }
.dialog__title { margin: 0 0 8px; font-size: 20px; }
.dialog__body { margin: 0 0 18px; color: var(--muted); }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 150; width: max-content; max-width: min(380px, calc(100vw - 32px)); }
.toast__card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: #14161B; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast__card p { margin: 0; font-weight: 800; }
.toast__card a, .toast__card button { color: #F5B301; font-weight: 900; background: none; border: 0; padding: 0; min-height: 36px; text-decoration: underline; }
.toast__card :focus-visible { outline-color: #F5B301; }

@media (max-width: 480px) {
  .demo-bar { padding: 8px 16px; }
  .demo-bar__label { display: none; }
  .demo-guide { margin-left: 0; }
  .phone { margin: 0; max-width: none; border-radius: 0; box-shadow: none; min-height: calc(100vh - 40px); }
  .view { padding: 16px 16px 24px; }
}
