/* RMA Airlines: the public site (home, booking, boarding pass, status, timetable, flight).
   Loaded after base.css, whose spacing (--space-1..6), gutter and type steps (--rma-text-*) it uses
   and nothing else. JetBrains Mono only for codes and figures (flight numbers, times, seats, fares). */

/* A passenger's status reads as words ("On time", "Delayed to 07:05"), not the model's lowercased code. */
.st.ps { text-transform: none; }
.hint { font-size: var(--rma-text-xs); color: var(--rma-ui-muted); }
.err.field-err { font-size: var(--rma-text-sm); }
.rma-field[aria-invalid="true"] { border-color: var(--rma-ui-danger); }
.rma-card-foot > span:empty { display: none; }
.rma-card-foot:has(> span:empty) { justify-content: flex-end; }

/* ---- Home: the search in the hero, the wire art in its own column on wide screens ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); align-items: center; }
.hero-main { display: grid; gap: var(--space-5); min-width: 0; }
.hero .art { display: none; }
/* The art is the brand's corner piece (a 1000-unit square that bleeds off its right edge). The hero shows
   one deliberate crop of it, the same at every size: x 400-1000 and y 150-720, the whole swoosh and
   the star above it; --art is the size the full square is drawn at. */
@media (min-width: 1280px) {
  .hero { --art: 480px; grid-template-columns: minmax(0, 1fr) calc(var(--art) * .6); column-gap: calc(var(--space-6) + var(--space-4)); /* 48 px */ }
  /* The corner piece bleeds off the screen's edge as drawn: the box reaches over the gutter to it, so
     the ribbon never ends in a cut short of the edge. */
  .hero .art { display: block; position: relative; overflow: hidden; height: calc(var(--art) * .57);
    margin-right: calc(-1 * max(var(--gutter), env(safe-area-inset-right, 0px))); }
  .hero .art img { display: block; position: absolute; right: 0; top: calc(var(--art) * -.15); width: var(--art); height: var(--art); max-width: none; }
}

/* The flight search: From, To, Date and the button on one row from 900 px; two columns, then one. */
.search-card { padding: var(--space-5); }
.search { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: end; }
.search .rma-btn { min-height: var(--ctl); }
@media (min-width: 640px) { .search { grid-template-columns: repeat(2, minmax(0, 1fr)); } .search .rma-btn { justify-self: start; } }
@media (min-width: 900px) {
  .search { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1fr) auto; }
  .search .rma-btn { justify-self: stretch; }
}
@media (max-width: 639px) { .search-card { padding: var(--space-4); } .search .rma-btn { width: 100%; } }
.search .rma-field, .status-form .rma-field { min-height: var(--ctl); }

/* The boards: departures and arrivals side by side from 900 px. */
.boards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
/* Side by side the two cards always end on one line (web.board gives them the same number of rows). */
@media (min-width: 900px) { .boards { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; } }
.rma-section-head a { color: var(--rma-ui-accent-text); }
/* Fixed columns, the same on both boards, so Departures and Arrivals line up stacked as well as side by
   side; the city takes what is left (and wraps, Cluj-Napoca at its hyphen, on a phone). */
.fids { table-layout: fixed; }
.fids th:nth-child(1) { width: 3.5rem; }
.fids th:nth-child(3) { width: 4.75rem; }
.fids th:nth-child(4) { width: 3.5rem; }
.fids th:nth-child(5) { width: 9.5rem; }
.fids td { vertical-align: baseline; }
.fids .city { color: var(--rma-ui-strong); overflow-wrap: break-word; }
.fids .w-short { display: none; }
.fids a { font-weight: 500; text-decoration: none; }
.fids a:hover { text-decoration: underline; }
.fids :is(th, td):last-child { white-space: nowrap; }
/* A phone: no gate, a step less padding, the short words (web.BOARD_SHORT; To and From over the city), so
   both boards fit 390 px on one line a flight; a status that still does not fit wraps under its dot. */
@media (max-width: 479px) {
  .fids :is(th, td):nth-child(4) { display: none; }
  .fids :is(th, td) { padding-right: var(--space-2); }
  .fids :is(th, td) + :is(th, td) { padding-left: var(--space-2); }
  .fids th:nth-child(1) { width: 3rem; }
  .fids th:nth-child(3) { width: 4.25rem; }
  .fids th:nth-child(5) { width: 7.75rem; }
  .fids .w-long { display: none; }
  .fids .w-short { display: inline; }
  .fids .st { white-space: normal; align-items: flex-start; }
  .fids .st::before { margin-top: calc((1lh - 7px) / 2); }
}

/* The map card at full width: wide on a wide screen, squarer on a phone. map.js sizes the canvas to it. */
.map.map-wide { aspect-ratio: 21 / 9; }
@media (max-width: 899px) { .map.map-wide { aspect-ratio: 4 / 3; } }

/* ---- Flight status: a table from 640 px; under it one flight per row, the number and status on the
   first line, the route on the second, the times on the third. ---- */
.status-form { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: end; }
.status-form .rma-btn { min-height: var(--ctl); }
@media (min-width: 640px) { .status-form { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; } }
.flights .k-sm, .flights .c-route { display: none; }
.flights td { vertical-align: baseline; }
.flights a { font-weight: 500; text-decoration: none; }
.flights s { margin-right: var(--space-1); }
@media (max-width: 639px) {
  .flights thead { display: none; }
  .flights, .flights tbody { display: block; }
  .flights tr:not(.none) { display: grid; grid-template-columns: auto auto minmax(0, 1fr); column-gap: var(--space-4); row-gap: var(--space-1);
    grid-template-areas: "no no st" "route route route" "dep arr gate"; padding: var(--space-3) 0; border-top: 1px solid var(--rma-ui-line); }
  .flights tr:first-child { border-top: 0; }
  .flights td { display: block; padding: 0; border: 0; }
  .flights .c-no { grid-area: no; font-size: var(--rma-text-base); }
  .flights .c-st { grid-area: st; justify-self: end; }
  .flights td.c-from, .flights td.c-to { display: none; }
  .flights td.c-route { display: block; grid-area: route; color: var(--rma-ui-strong); }
  .flights .c-dep { grid-area: dep; } .flights .c-arr { grid-area: arr; } .flights .c-gate { grid-area: gate; justify-self: end; }
  .flights .k-sm { display: inline; font-family: var(--rma-font-text); color: var(--rma-ui-muted); }
}

/* ---- Timetable: a card per destination ---- */
.tt .rma-card-head .mono { font-size: var(--rma-text-sm); }
.tt-group { display: grid; gap: var(--space-2); }
.tt-group + .tt-group { padding-top: var(--space-2); }
.tt .rma-line { gap: var(--space-3); }
.tt .rma-line > .muted { font-size: var(--rma-text-sm); }

/* ---- A flight's journey: both ends, the times, and the line between them ---- */
.journey { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-4); align-items: start; padding: var(--space-2) 0 var(--space-3); }
.journey .end { display: grid; gap: var(--space-1); min-width: 0; }
.journey .end-arr { text-align: right; justify-items: end; }
.journey .code { font: 500 var(--rma-text-sm)/1 var(--rma-font-mono); color: var(--rma-ui-muted); letter-spacing: .04em; }
.journey .time { font: 500 var(--rma-text-2xl)/var(--rma-leading-2xl) var(--rma-font-mono); color: var(--rma-ui-strong); font-variant-numeric: tabular-nums; }
.journey .time.late { color: var(--rma-ui-warning); }
.journey .was { font-size: var(--rma-text-sm); color: var(--rma-ui-muted); }
.journey .was s { font-family: var(--rma-font-mono); }
/* The city, and under it the airport's own name when it says more than the city (web.airport_name). */
.journey .place { display: grid; font-size: var(--rma-text-sm); color: var(--rma-ui-ink); max-width: 24ch; }
.journey .apt { font-size: var(--rma-text-xs); line-height: var(--rma-leading-xs); color: var(--rma-ui-muted); text-wrap: balance; }
.journey .mid { display: grid; gap: var(--space-2); justify-items: center; align-self: center; padding-top: var(--space-4); min-width: 0; }
.journey .dur { font-size: var(--rma-text-sm); color: var(--rma-ui-muted); }
.journey .line { position: relative; width: 100%; height: 2px; background: var(--rma-ui-edge); border-radius: 1px; }
.journey .line::before, .journey .line::after { content: ""; position: absolute; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--rma-ui-panel); border: 2px solid var(--rma-ui-box); box-sizing: border-box; }
.journey .line::before { left: -4px; } .journey .line::after { right: -4px; }
.journey .done { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--rma-ui-accent); border-radius: 1px; }
.journey .plane { position: absolute; top: -5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--rma-ui-accent); border: 2px solid var(--rma-ui-panel); box-sizing: border-box; }
.journey .plane[hidden] { display: none; }
.journey .ptext { font-size: var(--rma-text-sm); color: var(--rma-ui-muted); text-align: center; }
@media (max-width: 479px) {
  .journey { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: var(--space-3); }
  .journey .mid { grid-column: 1 / -1; grid-row: 2; padding-top: 0; }
  .journey .time { font-size: var(--rma-text-xl); }
}

.flight-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (min-width: 1280px) { .flight-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } }
.flight-page .facts { padding-top: var(--space-1); }
@media (min-width: 640px) and (max-width: 1279px) { .map.map-flight { aspect-ratio: 2 / 1; } }
.boarding { gap: var(--space-2); }
.map-card .live-lines { padding: var(--space-3) var(--space-5) var(--space-4); }
.map-card .live-lines[hidden] { display: none; }
@media (max-width: 639px) { .map-card .live-lines { padding: var(--space-3) var(--space-4) var(--space-3); } }

/* ---- Search results: one flight per row ---- */
.offers { gap: var(--space-3); }
.offer { display: grid; grid-template-columns: minmax(240px, 1.3fr) minmax(0, 1fr) auto; gap: var(--space-3) var(--space-6); align-items: center; }
.o-times { display: grid; grid-template-columns: auto minmax(64px, 1fr) auto; gap: var(--space-3); align-items: center; }
.o-t { font: 500 var(--rma-text-xl)/1 var(--rma-font-mono); color: var(--rma-ui-strong); font-variant-numeric: tabular-nums; }
.o-t small { font-size: var(--rma-text-xs); color: var(--rma-ui-muted); }
.o-mid { display: grid; gap: var(--space-1); justify-items: center; }
.o-dur { font-size: var(--rma-text-xs); color: var(--rma-ui-muted); white-space: nowrap; }
.o-direct { font-size: var(--rma-text-xs); color: var(--rma-ui-muted); }
.o-line { width: 100%; height: 1px; background: var(--rma-ui-box); }
.o-info { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: baseline; min-width: 0; font-size: var(--rma-text-sm); }
.o-buy { display: flex; gap: var(--space-4); align-items: center; justify-content: flex-end; }
.o-fare { white-space: nowrap; font-size: var(--rma-text-sm); }
.o-fare b { font: 500 var(--rma-text-md) var(--rma-font-mono); color: var(--rma-ui-strong); }
@media (max-width: 899px) {
  .offer { grid-template-columns: minmax(0, 1fr); }
  .o-buy { justify-content: space-between; padding-top: var(--space-3); border-top: 1px solid var(--rma-ui-line); }
}

/* ---- The booking form: flight, passengers, seats, contact. In that order on a phone; from 1024 px the
   passengers and contact on the left, the flight and the seat map on the right. ---- */
.book-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (min-width: 1024px) {
  .book-form { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: "err err" "pax flight" "pax seats" "contact seats" ". seats"; }
  .book-form > .err { grid-area: err; }
  .bf-pax { grid-area: pax; } .bf-flight { grid-area: flight; } .bf-seats { grid-area: seats; } .bf-contact { grid-area: contact; }
}
.book-form fieldset { gap: var(--space-3); }
.book-form fieldset + fieldset { padding-top: var(--space-4); }
.book-form .pax[hidden] { display: none; }
.pax-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: var(--space-3) var(--space-4); }
.add-pax { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; padding-top: var(--space-4); border-top: 1px solid var(--rma-ui-line); }
.add-pax[hidden] { display: none; }
.add-pax .muted { font-size: var(--rma-text-sm); }
.bf-contact .rma-card-foot { padding-top: var(--space-4); }

/* ---- Seat map: 44 px seats from the front, A-F once, the row number in the aisle ---- */
.seatmap { display: grid; gap: var(--space-4); justify-items: center; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: 0; padding: 0; list-style: none; font-size: var(--rma-text-sm); color: var(--rma-ui-ink); }
.legend li { display: inline-flex; align-items: center; gap: var(--space-2); }
/* Three states, told apart by more than colour: free is an empty seat with a firm outline, taken is
   filled grey with a cross (and cannot be pressed), yours is brand blue with the passenger's number. */
/* --seat-line: the free seat's outline, 3:1 or more on the card in light and dark (--rma-ui-box is about 2:1). */
.seatmap { --seat-line: color-mix(in srgb, var(--rma-ui-muted) 75%, var(--rma-ui-panel)); }
.seat-key { position: relative; width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--seat-line); background: var(--rma-ui-panel); }
.seat-key.is-taken, .seat[disabled] { border-color: transparent; background: var(--rma-ui-edge); }
.seat-key.is-picked { background: var(--rma-ui-accent); border-color: var(--rma-ui-accent); }
.seat-key.is-taken::before, .seat-key.is-taken::after, .seat[disabled]::before, .seat[disabled]::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 55%; height: 1.5px; border-radius: 1px; background: var(--rma-ui-muted); }
.seat-key.is-taken::before, .seat[disabled]::before { transform: translate(-50%, -50%) rotate(45deg); }
.seat-key.is-taken::after, .seat[disabled]::after { transform: translate(-50%, -50%) rotate(-45deg); }
.seat[disabled]::before, .seat[disabled]::after { width: 36%; height: 2px; }
.cabin { --seat: 44px; display: grid; gap: var(--space-1); width: 100%; max-width: calc(6 * var(--seat) + 3 * 32px + 8 * var(--space-1)); }
.cabin .front { text-align: center; font-size: var(--rma-text-xs); color: var(--rma-ui-muted); padding: var(--space-2) 0; border-top: 2px solid var(--rma-ui-box); border-radius: 50% 50% 0 0 / 16px 16px 0 0; }
.cabin .r { display: grid; grid-template-columns: 32px repeat(3, minmax(0, var(--seat))) 32px repeat(3, minmax(0, var(--seat))) 32px; gap: var(--space-1); align-items: center; justify-content: center; }
.cabin .head span { text-align: center; font: 500 var(--rma-text-xs) var(--rma-font-mono); color: var(--rma-ui-muted); }
.cabin .n { text-align: center; font: 400 var(--rma-text-xs) var(--rma-font-mono); color: var(--rma-ui-muted); }
.cabin .ex { font-size: var(--rma-text-xs); color: var(--rma-ui-warning); text-align: center; }
.seat { position: relative; height: var(--seat); width: 100%; border-radius: 8px 8px 4px 4px; border: 1.5px solid var(--seat-line); background: var(--rma-ui-panel);
  color: var(--rma-ui-accent-ink); font: 600 var(--rma-text-sm) var(--rma-font-mono); cursor: pointer; padding: 0; transition: background-color .12s, border-color .12s; }
.seat:not([disabled]):hover { border-color: var(--rma-ui-accent); background: var(--rma-ui-accent-sel); }
.seat[disabled] { cursor: not-allowed; }
.seat.picked, .seat.picked:hover { background: var(--rma-ui-accent); border-color: var(--rma-ui-accent); }
@media (max-width: 479px) { .cabin { --seat: 40px; } .cabin .r { grid-template-columns: 24px repeat(3, minmax(0, var(--seat))) 24px repeat(3, minmax(0, var(--seat))) 24px; } }

/* ---- Booking: the flight, then the passengers, one per row ---- */
.booking { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (min-width: 1024px) { .booking { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.pax-list { display: grid; margin: 0; padding: 0; list-style: none; }
.pax-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3) var(--space-4); align-items: center; padding: var(--space-3) 0; border-top: 1px solid var(--rma-ui-line); }
.pax-row:first-child { border-top: 0; padding-top: 0; }
.pax-who { display: grid; gap: var(--space-1); min-width: 0; }
.pax-name { font: 500 var(--rma-text-base) var(--rma-font-display); color: var(--rma-ui-strong); overflow-wrap: break-word; }
.pax-state { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: baseline; font-size: var(--rma-text-sm); }
.pax-seat { display: grid; gap: var(--space-1); justify-items: end; font-size: var(--rma-text-sm); }
.pax-seat b { font-size: var(--rma-text-md); font-weight: 500; color: var(--rma-ui-strong); }
label.pax-seat { justify-items: stretch; min-width: 160px; }
.pax-pass { grid-column: 1 / -1; justify-self: end; }
@media (max-width: 639px) {
  .pax-row { grid-template-columns: minmax(0, 1fr); }
  .pax-seat { justify-items: start; }
  label.pax-seat { min-width: 0; }
  .pax-pass { justify-self: stretch; }
}

/* ---- Manage ---- */
.form-card { max-width: 480px; width: 100%; gap: var(--space-4); }
.form-card label { gap: var(--space-2); }
.code-field { font-family: var(--rma-font-mono); text-transform: uppercase; letter-spacing: .08em; }

/* ---- Boarding pass: IATA order, phone width, centred, light in both modes ---- */
.pass-head { text-align: center; justify-items: center; }
.pass-actions { justify-content: center; }
.bp { justify-self: center; width: 100%; max-width: 440px; display: grid; gap: var(--space-5); padding: var(--space-5);
  background: var(--rma-ui-panel); color: var(--rma-ui-ink); border: 1px solid var(--rma-ui-edge); border-radius: 12px; }
.bp .label { color: var(--rma-ui-muted); }
.bp dl, .bp dd { margin: 0; }
.bp-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding-bottom: var(--space-4); border-bottom: 1px solid var(--rma-ui-line); }
.bp-brand { display: inline-flex; align-items: center; gap: var(--space-2); font: 600 var(--rma-text-md)/1 var(--rma-font-display); color: var(--rma-ui-strong); }
.bp-brand img { display: block; height: 24px; width: auto; }
.bp-name { display: grid; gap: var(--space-1); }
.bp-name b { font: 600 var(--rma-text-lg)/var(--rma-leading-lg) var(--rma-font-display); color: var(--rma-ui-strong); overflow-wrap: anywhere; }
.bp-route { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.bp-route > div { display: grid; gap: var(--space-1); }
.bp-route b { font: 600 var(--rma-text-2xl)/1 var(--rma-font-mono); color: var(--rma-ui-strong); }
.bp-route span:last-child { font-size: var(--rma-text-sm); }
.bp-to { text-align: right; justify-items: end; }
.bp-big { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); padding: var(--space-4) 0; border-top: 1px solid var(--rma-ui-line); border-bottom: 1px solid var(--rma-ui-line); }
.bp-big div, .bp-small div { display: grid; gap: var(--space-1); min-width: 0; }
.bp-big dd { font: 600 var(--rma-text-2xl)/1 var(--rma-font-mono); color: var(--rma-ui-strong); }
.bp-big div:last-child, .bp-small div:last-child { text-align: right; }
.bp-small { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: var(--space-4); }
.bp-small dd { font: 500 var(--rma-text-sm) var(--rma-font-mono); color: var(--rma-ui-strong); white-space: nowrap; }
.bp-small :is(.bp-date, .bp-group) dd { font-family: var(--rma-font-text); font-weight: 600; }
.bp-closes { margin: 0; font-size: var(--rma-text-sm); color: var(--rma-ui-ink); }
.bp-code { display: grid; justify-items: center; gap: var(--space-2); padding-top: var(--space-5); border-top: 1px dashed var(--rma-ui-box); color: var(--rma-ui-strong); }
.bp-code svg { display: block; width: 100%; max-width: 360px; height: auto; background: var(--rma-ui-panel); }
.bp-pnr { font-size: var(--rma-text-sm); color: var(--rma-ui-ink); }
.bp-pnr b { font: 500 var(--rma-text-base) var(--rma-font-mono); letter-spacing: .08em; color: var(--rma-ui-strong); }
.bp-note { font-size: var(--rma-text-xs); color: var(--rma-ui-muted); text-align: center; }
@media (max-width: 479px) {
  .bp { padding: var(--space-4); gap: var(--space-4); }
  .bp-small { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--space-3); }
  .bp-small .bp-date { grid-column: span 2; }
  .bp-small div:last-child { text-align: left; }
}

/* Printed: only the pass, on white, at its own width. */
@media print {
  @page { margin: 12mm; }
  html, body, main { background: none; }
  .top, footer, .pass-head, .pass-actions { display: none; }
  main { padding: 0; }
  .bp { max-width: 120mm; border-color: var(--rma-ui-box); break-inside: avoid; }
}

/* ---- Desktop density (base.css, at its head): a step tighter than on touch ---- */
@media (hover: hover) and (pointer: fine) {
  .hero { gap: var(--space-5); }
  .hero { --art: 350px; }
  .hero-main { gap: var(--space-4); }
  .search-card { padding: var(--space-4); }
  .search, .status-form { gap: var(--space-3); }
  .boards, .flight-page, .book-form, .booking { gap: var(--space-3); }
  .offers { gap: var(--space-2); }
  .map-card .live-lines { padding: var(--space-3) var(--space-4); }
  .pax-row { padding: var(--space-2) 0; }
  .form-card { gap: var(--space-3); }
  .form-card label { gap: var(--space-1); }
  /* Seats are clicked, not tapped. */
  .cabin { --seat: 36px; }
}

