/* TravelCorpo application shell — layout around the tc- component layer.
 *
 * Everything here composes tokens (var(--tc-…)) and the `tc-` classes; nothing invents a
 * colour, so the dark theme and the RTL switch keep working. This file is the app's own
 * chrome, not part of the 14.2/14.3 package: the design system stays untouched so it can be
 * replaced by TravelCorpo's tokens.json without touching a screen.
 */

/* --- shell ------------------------------------------------------------ */

.tc-body-app { margin: 0; background: var(--tc-surface); }

.tc-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tc-space-3, 12px);
  padding: 12px 24px;
  background: var(--tc-surface-raised);
  border-block-end: 1px solid var(--tc-line);
}

.tc-topbar__search {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 420px;
}

.tc-topbar__user {
  display: flex;
  flex-wrap: wrap;          /* wrap instead of pushing the bar sideways at 390 px */
  align-items: center;
  gap: 10px;
  min-width: 0;             /* flex items default to min-width:auto and refuse to shrink */
  margin-inline-start: auto;
  font-size: var(--tc-text-label);
  color: var(--tc-ink-muted);
}

.tc-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--tc-radius-pill);
  background: var(--tc-navy-soft);
  color: var(--tc-navy);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .02em;
}

/* --- grids and cards --------------------------------------------------- */

.tc-grid { display: grid; gap: 24px; }
.tc-grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tc-grid--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tc-grid--cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tc-grid--two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.tc-card {
  background: var(--tc-surface-raised);
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-radius-card);
  padding: 16px;
  box-shadow: var(--tc-shadow-card);
}

.tc-card--flush { padding: 0; overflow: hidden; }

/* Nested card: one row per passenger or per hotel inside the booking form. No shadow and a
   recessed background, so three passengers read as three rows of one card, not three cards. */
.tc-card--flat {
  box-shadow: none;
  background: var(--tc-surface);
  padding: 12px 16px;
  margin-block-end: 8px;
}

.tc-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-block-end: 12px;
}

.tc-card__title {
  font-family: var(--tc-font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--tc-ink);
  margin: 0;
}

.tc-card__count {
  margin-inline-start: auto;
  font-family: var(--tc-font-display);
  font-size: 22px;
  color: var(--tc-navy);
}

.tc-section { margin-block-end: 32px; }
.tc-section__title {
  font-family: var(--tc-font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tc-section__title .tc-badge { font-weight: 500; }

/* --- tiles (KPIs) ------------------------------------------------------ */

.tc-tile {
  background: var(--tc-surface-raised);
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-radius-card);
  padding: 14px 16px;
}
.tc-tile__label {
  font-size: var(--tc-text-caption, 12px);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tc-ink-muted);
}
.tc-tile__value {
  font-family: var(--tc-font-display);
  font-size: 26px;
  line-height: 1.15;
  color: var(--tc-ink);
  margin-block-start: 4px;
}
.tc-tile__hint { font-size: var(--tc-text-caption, 12px); color: var(--tc-ink-muted); }

/* --- lists ------------------------------------------------------------- */

.tc-list { list-style: none; margin: 0; padding: 0; }
.tc-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-block-start: 1px solid var(--tc-line);
}
.tc-list__item:first-child { border-block-start: 0; }
.tc-list__main { flex: 1 1 200px; min-width: 0; }
.tc-list__title { font-weight: 600; color: var(--tc-ink); }
.tc-list__meta { font-size: var(--tc-text-caption, 12px); color: var(--tc-ink-muted); }
.tc-list__side { margin-inline-start: auto; text-align: end; }

/* --- option cards ------------------------------------------------------ */

.tc-option__price {
  font-family: var(--tc-font-display);
  font-size: 22px;
  color: var(--tc-navy);
}
.tc-option__price-unit { font-size: 12px; color: var(--tc-ink-muted); margin-inline-start: 4px; }
.tc-option__segments { margin: 12px 0 0; padding: 0; list-style: none; }
.tc-option__segments li {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 6px 0;
  font-size: var(--tc-text-label, 13px);
  color: var(--tc-ink-muted);
  border-block-start: 1px dashed var(--tc-line);
}
.tc-option__segments li:first-child { border-block-start: 0; }
.tc-option__conditions { font-size: var(--tc-text-caption, 12px); color: var(--tc-ink-muted); }

/* --- thread ------------------------------------------------------------ */

.tc-thread { display: flex; flex-direction: column; gap: 12px; }
.tc-bubble {
  background: var(--tc-surface-sunken);
  border-radius: var(--tc-radius-card);
  padding: 10px 12px;
  max-width: 70ch;
}
.tc-bubble--mine { background: var(--tc-navy-soft); margin-inline-start: auto; }
.tc-bubble--internal { background: var(--tc-warning-soft); }
.tc-bubble__meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--tc-ink-muted);
  margin-block-end: 4px;
}
.tc-bubble__body { white-space: pre-wrap; }

/* --- timeline ---------------------------------------------------------- */

.tc-timeline { list-style: none; margin: 0; padding: 0; }
.tc-timeline li {
  display: flex; gap: 10px;
  padding: 8px 0;
  font-size: var(--tc-text-label, 13px);
  border-block-start: 1px solid var(--tc-line);
}
.tc-timeline li:first-child { border-block-start: 0; }
.tc-timeline__when { color: var(--tc-ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --- forms ------------------------------------------------------------- */

.tc-form-section {
  border-block-start: 1px solid var(--tc-line);
  margin-block-start: 20px;
  padding-block-start: 16px;
}
.tc-form-section__legend {
  font-family: var(--tc-font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--tc-navy);
  margin-block-end: 10px;
}
/* A column must fit a French select label plus its arrow: "Avec bagages enregistrés"
   is 193 px at 15 px, and the narrowest real band measured 222 px — 5 px short, so the
   selected option was clipped between roughly 640 and 860 px. 232 px is the sum of the
   longest real label and the arrow, so the band collapses to two columns instead. */
.tc-field__row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
/* 4.2.3 — a multi-destinations trip is a list of legs. Each leg is its own numbered
   block, so "Vol 2" reads as a second flight rather than as another field of Vol 1. */
.tc-flight-leg + .tc-flight-leg {
  margin-block-start: 12px;
  padding-block-start: 12px;
  border-block-start: 1px dashed var(--tc-line);
}
/* 5.3 — the same idea in the agent's option builder: an option can hold several
   flights, and each one is a numbered block so a connection is not read as remarks. */
.tc-leg + .tc-leg {
  margin-block-start: 12px;
  padding-block-start: 12px;
  border-block-start: 1px dashed var(--tc-line);
}
.tc-leg__title {
  font-weight: 600;
  color: var(--tc-navy);
  margin-block-end: 8px;
}
.tc-leg__add { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-block: 12px; }
.tc-flight-leg__title {
  font-family: var(--tc-font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--tc-ink-muted);
  margin-block-end: 8px;
}
/* The leg title and its "Supprimer" button share one row, so removing a flight reads as
   an action on that flight rather than on the whole request. */
.tc-flight-leg__head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 8px;
}
.tc-flight-leg__head .tc-flight-leg__title { margin-block-end: 0; min-width: 0; }
.tc-form-actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center;
  margin-block-start: 24px;
}
/* The `hidden` attribute is only `display:none` from the user agent, so any class that
   sets a display (`display:flex` on a form-actions row, `inline-flex` on a button) wins
   and the element stays on screen. That is how "Ajouter un vol" showed up on a one-way
   trip and how a remove button appeared on a leg that cannot be removed. */
[hidden] { display: none !important; }
/* 4.2 — a booking of several rooms is several blocks, one per room. */
.tc-hotel-room + .tc-hotel-room {
  margin-block-start: 12px;
  padding-block-start: 12px;
  border-block-start: 1px dashed var(--tc-line);
}
.tc-hotel-rooms:empty { display: none; }
.tc-checkgrid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.tc-checkgrid .tc-checkbox { display: flex; align-items: center; gap: 8px; min-height: 44px; }

/* --- meeting rooms: one block per room, and a diagram per setup (10.2) --- */

/* Cvent's room-night curve: one short column per night of the stay. Filled in, it is the
   exact pick-up; left empty, the three totals above remain the answer. */
.tc-night-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.tc-night-grid .tc-field__label { font-size: 13px; }

.tc-room-block {
  margin-block-start: 12px;
  padding-block-start: 12px;
  border-block-start: 1px dashed var(--tc-line);
}
.tc-room-block:first-child { margin-block-start: 0; padding-block-start: 0; border-block-start: 0; }
.tc-room-block__legend {
  font-family: var(--tc-font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--tc-navy);
  margin-block-end: 8px;
}
.tc-layout-picker { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
/* A word like "cabaret" means nothing to someone who has never hired a room, so each
   choice is a card carrying its plan. The radio is present and focusable, invisible. */
.tc-layout-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 96px;
  padding: 8px 6px;
  border: 1px solid var(--tc-line);
  border-radius: 10px;
  background: var(--tc-surface-raised);
  color: var(--tc-ink);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
}
.tc-layout-option:hover { border-color: var(--tc-line-strong); }
.tc-layout-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tc-layout-option:has(input:checked) {
  border-color: var(--tc-navy);
  background: var(--tc-navy-soft);
  box-shadow: inset 0 0 0 1px var(--tc-navy);
}
.tc-layout-option:has(input:focus-visible) { outline: 3px solid var(--tc-focus); outline-offset: 2px; }
.tc-layout-option__label { font-weight: 600; }
.tc-roomart { width: 72px; height: 50px; color: var(--tc-ink-muted); }
.tc-layout-option:has(input:checked) .tc-roomart { color: var(--tc-navy); }
.tc-roomart__stage { opacity: 0.5; }

/* --- collapsible RFP blocks (10.2) ------------------------------------- */

.tc-details {
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-radius-card, 10px);
  padding: 0 16px 16px;
  margin-block-start: 12px;
  background: var(--tc-surface-raised);
}
.tc-details > summary {
  cursor: pointer;
  padding-block: 14px;
  font-family: var(--tc-font-display);
  font-weight: 600;
  color: var(--tc-navy);
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tc-details > summary:hover { color: var(--tc-ink); }
.tc-details[open] > summary { border-block-end: 1px solid var(--tc-line); margin-block-end: 16px; }
.tc-details:focus-within { outline: 2px solid var(--tc-focus, var(--tc-navy)); outline-offset: 2px; }

.tc-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  padding-block: 8px 24px;
}
.tc-actions-row .tc-btn { min-height: 44px; }

/* --- table ------------------------------------------------------------- */

.tc-table-wrap { overflow-x: auto; }
.tc-table { width: 100%; border-collapse: collapse; font-size: var(--tc-text-label, 13px); }
.tc-table th {
  text-align: start;
  font-weight: 600;
  color: var(--tc-ink-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .06em;
  padding: 10px 12px;
  border-block-end: 1px solid var(--tc-line);
  white-space: nowrap;
}
.tc-table td { padding: 12px; border-block-end: 1px solid var(--tc-line); vertical-align: middle; }
.tc-table tr:last-child td { border-block-end: 0; }
.tc-table tbody tr:hover { background: var(--tc-surface); }

/* --- login ------------------------------------------------------------- */

.tc-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 15% -10%, color-mix(in srgb, var(--tc-navy) 92%, black), var(--tc-navy) 55%, var(--tc-navy-deep));
}
.tc-login__card {
  width: 100%;
  max-width: 420px;
  background: var(--tc-surface-raised);
  border-radius: var(--tc-radius-panel);
  padding: 28px;
  box-shadow: 0 24px 60px rgba(2, 34, 71, .35);
}
.tc-login__brand {
  display: flex; align-items: center; gap: 10px;
  margin-block-end: 6px;
}
.tc-login__mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--tc-gold); color: var(--tc-on-gold);
  display: grid; place-items: center;
  font-family: var(--tc-font-display); font-weight: 700;
}
.tc-login__title { font-family: var(--tc-font-display); font-size: 22px; margin: 0; }
.tc-login__sub { color: var(--tc-ink-muted); font-size: var(--tc-text-label, 13px); margin: 4px 0 22px; }
.tc-login__hint {
  margin-block-start: 20px; padding-block-start: 16px;
  border-block-start: 1px solid var(--tc-line);
  font-size: 12px; color: var(--tc-ink-muted);
}

/* Demo account list (staging only, DEMO_LOGIN_HINTS). Rows must look clickable: the earlier
   version used a ghost button, which reads as plain text, so reviewers did not know to click. */
.tc-login__demo {
  margin-block-start: 24px; padding-block-start: 20px;
  border-block-start: 1px solid var(--tc-line);
}
.tc-demo-note {
  margin: 0 0 14px;
  font-size: 12px; line-height: 1.5; color: var(--tc-ink-muted);
}
.tc-demo-note strong { color: var(--tc-ink); }
.tc-demo-note code { font-family: var(--tc-font-mono); font-size: 12px; color: var(--tc-ink); }
.tc-demo-group + .tc-demo-group { margin-block-start: 14px; }
.tc-demo-group__caption {
  margin: 0 0 6px;
  font-size: 11px; font-weight: var(--tc-weight-semibold); letter-spacing: .06em;
  text-transform: uppercase; color: var(--tc-ink-muted);
}
.tc-demo-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tc-demo-account {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: start; cursor: pointer;
  padding: 9px 12px;
  background: var(--tc-surface-raised);
  border: 1px solid var(--tc-line-strong);
  border-radius: var(--tc-radius-field);
  font: inherit; color: inherit;
  transition: background-color var(--tc-fast-duration) var(--tc-easing),
              border-color var(--tc-fast-duration) var(--tc-easing);
}
.tc-demo-account:hover { background: var(--tc-navy-soft); border-color: var(--tc-navy); }
.tc-demo-account:focus-visible { outline: 2px solid var(--tc-focus); outline-offset: 2px; }
.tc-demo-account__name {
  display: block; font-size: 13px; font-weight: var(--tc-weight-semibold); color: var(--tc-ink);
}
.tc-demo-account__email { display: block; font-size: 11.5px; color: var(--tc-ink-muted); }
.tc-demo-account__go { flex: none; font-weight: 700; color: var(--tc-navy); }


/* --- misc -------------------------------------------------------------- */

.tc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-inline-form { display: inline; }
.tc-mono-sm { font-family: var(--tc-font-mono); font-size: 12px; }
.tc-muted { color: var(--tc-ink-muted); }
.tc-strong { font-weight: 600; }
.tc-num { font-variant-numeric: tabular-nums; }
.tc-spacer { flex: 1 1 auto; }
.tc-flashes { margin-block-end: 16px; display: grid; gap: 8px; }
.tc-hr { border: 0; border-block-start: 1px solid var(--tc-line); margin: 16px 0; }
/* A key/value list built from .tc-kv__row divs, not from dt/dd pairs: the two-column grid
   of the design system would put each row side by side and overflow the card. */
.tc-kv--rows { display: block; }
.tc-kv__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 6px 0; min-width: 0; }
.tc-kv__label { color: var(--tc-ink-muted); min-width: 0; }
.tc-kv__value { font-weight: 600; text-align: end; min-width: 0; max-inline-size: 100%; overflow-wrap: anywhere; }
.tc-pill-note {
  display: inline-block;
  background: var(--tc-gold-soft);
  color: var(--tc-gold-ink);
  border-radius: var(--tc-radius-pill);
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
}
.tc-danger-zone { border: 1px solid var(--tc-danger); border-radius: var(--tc-radius-card); padding: 12px; }

/* --- city picker (4.2.5) ---------------------------------------------- */

.tc-combo { position: relative; }

.tc-combo__input { inline-size: 100%; }

.tc-combo__list {
  position: absolute;
  z-index: 30;
  inset-inline: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  max-block-size: 280px;
  overflow-y: auto;
  background: var(--tc-surface-raised);
  border: 1px solid var(--tc-line-strong, var(--tc-line));
  border-radius: var(--tc-radius-button, 10px);
  box-shadow: var(--tc-shadow-raised, 0 8px 24px rgba(11, 27, 51, .12));
}

.tc-combo__option {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--tc-text-body, 15px);
  color: var(--tc-ink);
}

.tc-combo__option--active,
.tc-combo__option:hover { background: var(--tc-navy-soft); }

.tc-combo__label { font-weight: 600; }

.tc-combo__hint {
  font-size: var(--tc-text-label, 13px);
  color: var(--tc-ink-muted);
}

.tc-combo__status:empty { display: none; }
.tc-combo__status {
  margin: 4px 0 0;
  font-size: var(--tc-text-label, 13px);
  color: var(--tc-ink-muted);
}

@media (max-width: 639px) {
  .tc-content { padding: 16px; }
  .tc-topbar { padding: 10px 16px; }
  .tc-bubble { max-width: 100%; }
  .tc-combo__list { max-block-size: 220px; }

  /* 11.1/14.4 — mobile first. The design system stacks the sidebar above the content
     below 1280px, which on a 390×844 phone pushed the first form field to y = 1048:
     the client opened a request form and saw no field. Here the header becomes one
     compact row of horizontally scrollable links, so the screen is the form. */
  .tc-sidebar {
    padding: 6px 12px;
    position: sticky;
    inset-block-start: 0;
    z-index: 40;
  }
  .tc-sidebar__brand { padding-block: 2px; font-size: 15px; gap: 8px; }
  .tc-sidebar__brand::before { width: 8px; height: 8px; }
  .tc-sidebar__caption { display: none; }
  .tc-sidebar nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-block: 6px 2px;
    scrollbar-width: none;
  }
  .tc-sidebar nav::-webkit-scrollbar { display: none; }
  .tc-nav-link {
    flex: 0 0 auto;
    min-height: 40px;
    padding-inline: 10px;
    font-size: 13px;
    gap: 6px;
    white-space: nowrap;
  }
  /* the postal address stays (3.3) but as one quiet line instead of a block */
  .tc-sidebar > div:last-child {
    padding-block-start: 2px !important;
    font-size: 10px !important;
    line-height: 1.3;
  }
  .tc-topbar { min-height: 56px; padding-block: 8px; row-gap: 8px; }
  .tc-topbar__search { flex-basis: 100%; max-width: none; }
  .tc-topbar__user { flex-basis: 100%; margin-inline-start: 0; justify-content: flex-start; }
  .tc-page-head { gap: 8px; }
  .tc-page-head .tc-display { font-size: 22px; }
}
