/* The transition from the chosen flight to the cabin seat map */

:root {
  --fondo: #eeebe5;          /* the warm grey around the app */
  --carta: #ffffff;          /* the app */
  --riga: #f7f5f1;           /* the flight rows */
  --bordo: #e7e2da;          /* thin lines */
  --testo: #17171a;
  --tenue: #7c776f;
  --accento: #e2552b;        /* Tarnwick tangerine: the chosen seat, the button */
  --accento-chiaro: #fdebe4;
  --spazio: #3f6fd8;         /* extra legroom seats */
  --spazio-chiaro: #e7eefc;
  --preso: #e9e5de;          /* taken seats */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: clamp(11px, min(3.4vw, 2.5vh), 16px); }
html, body { height: 100%; }
body {
  background: radial-gradient(120% 90% at 50% 0%, #f6f4f0 0%, var(--fondo) 60%);
  color: var(--testo);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.stage {
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
}

.app {
  position: relative;
  width: min(460px, 92vw);
  height: min(600px, 88vh);
  background: var(--carta);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 2px rgba(30, 24, 16, 0.06),
    0 12px 28px -12px rgba(30, 24, 16, 0.18),
    0 40px 70px -40px rgba(30, 24, 16, 0.3);
}

/* ---- the list ---- */
.list, .seatview {
  position: absolute;
  inset: 0;
  padding: 1.15rem 1.1rem;
  display: flex;
  flex-direction: column;
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.brand { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 650; font-size: 1rem; letter-spacing: -0.01em; }
.brand__mark { width: 1.25rem; height: 1.25rem; fill: var(--accento); }
.search {
  display: inline-flex; flex-direction: column; align-items: flex-end;
  padding: 0.35rem 0.75rem; border-radius: 999px; background: var(--riga); border: 1px solid var(--bordo);
}
.search__route { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 640; font-size: 0.82rem; }
.search__route svg { width: 0.95rem; height: 0.5rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.search__meta { font-size: 0.68rem; color: var(--tenue); }
.days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.35rem; margin-top: 0.95rem; }
.day { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.45rem 0 0.4rem; border-radius: 12px; border: 1px solid transparent; }
.day__d { font-size: 0.66rem; color: var(--tenue); }
.day__p { font-size: 0.8rem; font-weight: 620; }
.day.is-now { background: var(--accento-chiaro); border-color: #f6cbbb; }
.day.is-now .day__p { color: var(--accento); }
.note { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 0.35rem; font-size: 0.68rem; color: var(--tenue); padding-top: 0.6rem; }
.note svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.count { margin: 0.9rem 0 0.55rem; font-size: 0.74rem; color: var(--tenue); }

.rows { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }

/* the row and the header share every measure, so one can turn into the other */
.row, .hdr {
  position: relative;
  width: 100%;
  height: clamp(54px, 13vmin, 68px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 1fr 1fr;
  column-gap: 0.75rem;
  align-items: center;
  padding: 0 0.95rem 0 0.75rem;
  border-radius: 16px;
  background: var(--riga);
  border: 1px solid var(--bordo);
  text-align: left;
}
.row { transition: box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease; }
.row .logo, .hdr .back { grid-row: 1 / 3; }
.row__times { align-self: end; display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.98rem; letter-spacing: -0.01em; }
.row__times b { font-weight: 650; }
.row__times svg { width: 1.3rem; height: 0.5rem; fill: var(--tenue); stroke: var(--tenue); stroke-width: 1.1; }
.row__meta { grid-column: 2; align-self: start; font-size: 0.72rem; color: var(--tenue); margin-top: 0.12rem; }
.row__price { grid-column: 3; grid-row: 1 / 3; font-weight: 680; font-size: 1.05rem; }

.logo {
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accento-chiaro);
}
.logo svg { width: 1.15rem; height: 1.15rem; fill: var(--accento); }

@media (hover: hover) {
  .row:hover, .row.is-hover { background: #fff; border-color: #ded8ce; box-shadow: 0 10px 22px -14px rgba(30, 24, 16, 0.4); }
  .go:hover .go__in { transform: translateX(1px); }
  .seat:not(.is-taken):hover .seat__in, .seat.is-hover .seat__in { transform: translateY(-1px); box-shadow: 0 4px 8px -4px rgba(30, 24, 16, 0.35); }
}
.row:focus-visible, .seat:focus-visible, .back:focus-visible, .go:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

/* ---- the seat page ---- */
.seatview { visibility: hidden; }
.hdr { background: #fff; border-color: #ded8ce; box-shadow: 0 10px 24px -16px rgba(30, 24, 16, 0.45); z-index: 2; }
.back { position: relative; width: 2.2rem; height: 2.2rem; border-radius: 50%; }
.back .logo, .back__arrow { position: absolute; inset: 0; }
.back__arrow { display: grid; place-items: center; border-radius: 50%; background: var(--testo); opacity: 0; }
.back__arrow svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pick { margin: 0.9rem 0 0.3rem; font-size: 0.82rem; font-weight: 600; text-align: center; }

.cabin { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.hull { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hull path { stroke-dasharray: 1; fill: none; stroke: #d9d3c9; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.hull path.wing { stroke: #e2ddd4; stroke-width: 6; }

.grid {
  --s: 22px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, var(--s)) calc(var(--s) * 0.9) repeat(3, var(--s));
  gap: calc(var(--s) * 0.22);
  align-items: center;
  justify-items: center;
}
.letter { font-size: calc(var(--s) * 0.44); color: var(--tenue); font-weight: 600; }
.num { font-size: calc(var(--s) * 0.42); color: #a8a299; font-weight: 600; }
.gap-exit { grid-column: 1 / -1; height: calc(var(--s) * 0.18); }

.seat { width: var(--s); height: var(--s); padding: 0; }
.seat__in {
  position: relative;
  display: block; width: 100%; height: 100%;
  border-radius: calc(var(--s) * 0.28) calc(var(--s) * 0.28) calc(var(--s) * 0.2) calc(var(--s) * 0.2);
  background: #fff;
  border: 1.5px solid #cfc9bf;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.25s ease, border-color 0.25s ease;
}
.seat__in::after { /* the headrest */
  content: '';
  position: absolute; left: 22%; right: 22%; top: 14%; height: 14%;
  border-radius: 99px; background: currentColor; opacity: 0.16;
}
.seat.is-room .seat__in { border-color: var(--spazio); background: var(--spazio-chiaro); color: var(--spazio); }
.seat.is-taken { cursor: default; }
.seat.is-taken .seat__in { background: var(--preso); border-color: var(--preso); color: #bdb6ab; }
.seat.is-on .seat__in { background: var(--accento); border-color: var(--accento); color: #fff; box-shadow: 0 6px 12px -6px rgba(226, 85, 43, 0.7); }
.seat__tick { position: absolute; inset: 18% 18% 12%; width: 64%; height: 70%; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

.legend { display: flex; justify-content: center; gap: 0.9rem; margin: 0.35rem 0 0.2rem; font-size: 0.66rem; color: var(--tenue); }
.legend span { display: inline-flex; align-items: center; gap: 0.3rem; }
.dot { position: relative; width: 0.62rem; height: 0.72rem; border-radius: 3px 3px 2px 2px; border: 1.3px solid #cfc9bf; background: #fff; display: inline-block; }
/* the legend keys are tiny seats, like the ones in the map: the backrest bar on top */
.dot::before { content: ""; position: absolute; left: 18%; right: 18%; top: 14%; height: 1.4px; border-radius: 1px; background: currentColor; opacity: 0.35; }
.dot--room { border-color: var(--spazio); background: var(--spazio-chiaro); }
.dot--taken { border-color: var(--preso); background: var(--preso); }

.bar {
  margin: 0.45rem 0 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 0.55rem 0.55rem 0.95rem;
  border-radius: 16px;
  background: var(--testo); color: #fff;
  box-shadow: 0 14px 26px -16px rgba(23, 23, 26, 0.7);
}
.bar__seat { display: inline-flex; align-items: baseline; gap: 0.45rem; }
.bar__label { font-size: 0.7rem; color: rgba(255, 255, 255, 0.55); }
.bar__seat b { font-weight: 680; font-size: 1.05rem; }
.bar__kind { font-size: 0.72rem; color: rgba(255, 255, 255, 0.7); }
.go { border-radius: 999px; background: var(--accento); color: #fff; padding: 0.55rem 0.95rem; font-weight: 620; font-size: 0.82rem; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset; }
.go__in { display: inline-flex; align-items: center; gap: 0.35rem; transition: transform 0.2s ease; }
.go svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.cursor {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: #17171a; stroke: #fff; stroke-width: 1.4;
  pointer-events: none; opacity: 0; z-index: 10;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
