/* =============================================================================
   Theme switch: light / dark / system.

   Loaded LAST by Views/Shared/_DesignSystem.cshtml (after the client sheets), so the dark
   palette also wins over a deployment's own --c-* tokens. Nothing here applies in light mode:
   every palette rule is scoped to :root[data-theme="dark"], and theme.js sets that attribute
   (resolving "system" through prefers-color-scheme). Printed pages (vouchers) stay light.
   ========================================================================== */

/* Switch button (injected by theme.js). Discreet icon-only round button. */
.theme-switch { position: relative; display: inline-flex; flex: none; }
.theme-switch--floating { position: fixed; top: 10px; right: 10px; z-index: 70; }
.theme-switch__btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border-radius: 50%; border: 1px solid var(--c-border-2); background: var(--c-surface);
  color: var(--c-ink-2); cursor: pointer; opacity: .8; line-height: 1;
  transition: opacity .15s ease, background-color .15s ease; }
.theme-switch__btn:hover, .theme-switch__btn[aria-expanded="true"] { opacity: 1; background: var(--c-surface-2); }
.theme-switch__btn svg { width: 17px; height: 17px; }
.theme-switch__menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 140px; margin: 0; padding: 4px;
  list-style: none; background: var(--c-surface); color: var(--c-ink);
  border: 1px solid var(--c-border); border-radius: var(--r-md); box-shadow: var(--shadow-md); z-index: 71; }
.theme-switch__menu[hidden] { display: none; }
.theme-switch__item {
  display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 10px; border: 0;
  background: transparent; color: inherit; font: inherit; font-size: var(--fs-sm); text-align: left;
  border-radius: var(--r-sm); cursor: pointer; }
.theme-switch__item svg { width: 15px; height: 15px; }
.theme-switch__item:hover { background: var(--c-surface-2); }
.theme-switch__item[aria-checked="true"] { font-weight: 700; color: var(--c-primary-700); }
.theme-switch__item[aria-checked="true"]::after { content: "\2713"; margin-left: auto; }
@media print { .theme-switch { display: none !important; } }

/* Optional client dark-mode lockup (custom\logo-dark.*): the light lockup stays the default and
   print always uses it; in dark mode on screen the two are swapped. */
img.logo-dark { display: none; }
@media screen {
:root[data-theme="dark"] img.logo-light { display: none; }
:root[data-theme="dark"] img.brand-logo.logo-dark { display: inline-block; }
:root[data-theme="dark"] img.brand__logo.logo-dark { display: block; }
}

@media screen {
:root[data-theme="dark"] {
  color-scheme: dark;

  --c-primary-900: #240003;
  --c-primary-700: #8E0A12;
  --c-primary-600: #A3141D;
  --c-primary-500: #B8232C;
  --c-primary-200: #5A2427;
  --c-primary-100: #34191B;
  --c-primary-050: #2A1819;
  --c-accent-700: #8E0A12;
  --c-accent-600: #B8232C;
  --c-accent-500: #A3141D;
  --c-accent-300: #D98285;
  --c-accent-100: #F6E9EA;   /* stays light: used as text on the hero */

  --c-brand-orange-600: #FFA500;
  --c-brand-orange-700: #FFB84D;   /* text-safe orange on dark grounds */
  --c-brand-orange-100: #3A2A10;

  --c-ink:     #ECE9EA;
  --c-ink-2:   #D2CDCE;
  --c-muted:   #A9A3A5;
  --c-faint:   #8A8486;
  --c-on-dark: #FFFFFF;

  --c-surface:   #1F1A1B;
  --c-sand:      #151112;
  --c-surface-2: #292324;
  --c-surface-3: #332C2D;
  --c-border:    #3A3233;
  --c-border-2:  #4A4142;

  --c-success: #5CC48A;  --c-success-bg: #16301F;
  --c-danger:  #FF7B88;  --c-danger-bg:  #3A1A1E;
  --c-warn:    #FFB84D;  --c-warn-bg:    #3A2A10;
  --c-info:    #E8A0A4;  --c-info-bg:    #34191B;

  --c-src-direct: #B9B2B4;  --c-src-tgx: #B9B2B4;  --c-src-cyberesa: #B9B2B4;
  --c-src-dotw:   #B9B2B4;  --c-src-lightresa: #B9B2B4;

  --c-hero-ink: #1A0305;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.40);
  --shadow-md: 0 2px 8px rgba(0,0,0,.45);
  --shadow-lg: 0 6px 20px rgba(0,0,0,.55);
  --ibe-shadow:    0 6px 18px -8px rgba(0,0,0,.60);
  --ibe-shadow-sm: 0 1px 4px rgba(0,0,0,.40);
}

/* Surfaces the design system paints with a literal #fff (tokens alone do not reach them). */
:root[data-theme="dark"] .badge--outline,
:root[data-theme="dark"] .segmented__btn.is-active,
:root[data-theme="dark"] .nav-bar,
:root[data-theme="dark"] .search-tab.is-active,
:root[data-theme="dark"] .stepper,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .modal,
:root[data-theme="dark"] .spec-panel__body table,
:root[data-theme="dark"] .spec-panel__body code,
:root[data-theme="dark"] .filters,
:root[data-theme="dark"] .flight-card,
:root[data-theme="dark"] .trip-type.is-active,
:root[data-theme="dark"] .rmc,
:root[data-theme="dark"] .rmc__rate:has(.rate-row__check:checked),
:root[data-theme="dark"] .results-search .trip-type,
:root[data-theme="dark"] .rooms-summary { background: var(--c-surface); }

:root[data-theme="dark"] .segmented__btn.is-active,
:root[data-theme="dark"] .search-tab.is-active,
:root[data-theme="dark"] .trip-type.is-active,
:root[data-theme="dark"] .header-phone,
:root[data-theme="dark"] .theme-switch__item[aria-checked="true"] { color: var(--c-brand-orange-700); }

/* Form controls and plain links. */
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background-color: var(--c-surface-2); color: var(--c-ink); border-color: var(--c-border-2); }
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: var(--c-faint); }
:root[data-theme="dark"] a:not([class]) { color: var(--c-brand-orange-700); }
:root[data-theme="dark"] code { background: var(--c-surface-3); color: var(--c-brand-orange-700); }
:root[data-theme="dark"] .map-embed {
  background: repeating-linear-gradient(45deg, #231E1F, #231E1F 12px, #2B2526 12px, #2B2526 24px); }
:root[data-theme="dark"] img { filter: brightness(.92); }

/* Search panel, date-range calendar and other popovers: painted with a literal #fff by the design system (ticket 59815). */
:root[data-theme="dark"] .ibe-pop,
:root[data-theme="dark"] .popover,
:root[data-theme="dark"] .pcal__nav,
:root[data-theme="dark"] .search-fields,
:root[data-theme="dark"] .ibe-search,
:root[data-theme="dark"] .ibe-search__pill,
:root[data-theme="dark"] .qty button,
:root[data-theme="dark"] .swap-btn,
:root[data-theme="dark"] .currency-select,
:root[data-theme="dark"] .price-cal__cell,
:root[data-theme="dark"] .rmc__box,
:root[data-theme="dark"] .qf-chip,
:root[data-theme="dark"] .fdet__chip,
:root[data-theme="dark"] .vref__item,
:root[data-theme="dark"] .mapmodal,
:root[data-theme="dark"] .tl-point::before,
:root[data-theme="dark"] .fdet__m--wait i,
:root[data-theme="dark"] .fdet__m--fly::after { background: var(--c-surface); }
:root[data-theme="dark"] .ibe-pop { border-color: var(--c-border-2); }
:root[data-theme="dark"] .pcal__nav:hover { background: var(--c-primary-050); }
:root[data-theme="dark"] .pcal__day.is-unavail .d { color: var(--c-faint); opacity: .7; }
:root[data-theme="dark"] .ibe-topbar { background: rgba(31,26,27,.9); }
:root[data-theme="dark"] .hotel-card__fav { background: rgba(31,26,27,.85); color: var(--c-ink); }

/* Dark-red brand text (--c-primary-600/700, --c-accent-700) is unreadable on dark grounds (ticket 59815):
   texts, links, ghost buttons (popular destinations / flights chips), badges and icons use the light orange instead. */
:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] .btn--ghost,
:root[data-theme="dark"] .linklike,
:root[data-theme="dark"] .input-icon > .ico,
:root[data-theme="dark"] .brand,
:root[data-theme="dark"] .brand__name b,
:root[data-theme="dark"] .main-nav a:hover,
:root[data-theme="dark"] .main-nav a.is-active,
:root[data-theme="dark"] .header-phone .ico,
:root[data-theme="dark"] .search-tab .soon,
:root[data-theme="dark"] .qty button,
:root[data-theme="dark"] .stepper__item.is-done > a,
:root[data-theme="dark"] .stepper__item.is-done > span,
:root[data-theme="dark"] .rate-net,
:root[data-theme="dark"] .recap__total .amount,
:root[data-theme="dark"] .amenity .ico,
:root[data-theme="dark"] .swap-btn,
:root[data-theme="dark"] .leg__time .leg__day,
:root[data-theme="dark"] .cabin-badge,
:root[data-theme="dark"] .checkbox:hover,
:root[data-theme="dark"] .radio:hover,
:root[data-theme="dark"] details > summary:hover,
:root[data-theme="dark"] .hotel-card__name-link:hover,
:root[data-theme="dark"] .formule-chip:hover,
:root[data-theme="dark"] .rate-row__board-name,
:root[data-theme="dark"] .rooms-summary__price .price-now,
:root[data-theme="dark"] .rmc__specs .rmc__pax-icons,
:root[data-theme="dark"] .rmc__details,
:root[data-theme="dark"] .rmc__desc-more,
:root[data-theme="dark"] .search-advanced-toggle,
:root[data-theme="dark"] .results-search .search-advanced-toggle,
:root[data-theme="dark"] .results-search .search-advanced .checkbox:focus-within,
:root[data-theme="dark"] .fdet > summary,
:root[data-theme="dark"] .fdet > summary:hover,
:root[data-theme="dark"] .fdet__no,
:root[data-theme="dark"] .fdet__t sup,
:root[data-theme="dark"] .fdet__t .fdet__wait,
:root[data-theme="dark"] .fdet__sub b,
:root[data-theme="dark"] .srch__plane,
:root[data-theme="dark"] .srch__pct,
:root[data-theme="dark"] .frule__code,
:root[data-theme="dark"] .payfinder__caret,
:root[data-theme="dark"] .payfinder__clear:hover,
:root[data-theme="dark"] .msort__row.is-active,
:root[data-theme="dark"] .lang-switch a:hover,
:root[data-theme="dark"] .infocard__ico,
:root[data-theme="dark"] .infocard__body a,
:root[data-theme="dark"] .infocard__social .footer-social__link,
:root[data-theme="dark"] .gcard__title a:hover,
:root[data-theme="dark"] #m-toolbar .mtoolbar__btn.is-active { color: var(--c-brand-orange-700); }
/* Links on solid brand buttons and on the hero keep their own (light) text. */
:root[data-theme="dark"] .btn--primary,
:root[data-theme="dark"] .btn--accent,
:root[data-theme="dark"] .formule-chip.is-active { color: #fff; }
/* Selected stay in the calendar and the chosen payment agency: light text on the dark tints. */
:root[data-theme="dark"] .pcal__day.is-inrange .d { color: var(--c-ink); }
:root[data-theme="dark"] .payfinder__control.is-chosen { background: var(--c-surface-3); }
:root[data-theme="dark"] .payfinder__control.is-chosen .input { color: var(--c-ink); }
/* Chosen payment mode (.payopt): the design system tints it with --c-accent-100, which stays light in
   dark mode, leaving the light label and amount unreadable on a pink ground. Use the dark brand tint. */
:root[data-theme="dark"] .payopt:has(input:checked) { background: var(--c-primary-100); }

/* The voucher / confirmation sheet is a paper document: .voucher keeps its white ground in every theme
   (it is what gets printed), so it must keep the light text tokens too. Without this the labels, values
   and amounts inherit the dark theme's light ink and vanish on the white sheet. */
:root[data-theme="dark"] .voucher {
  color-scheme: light;
  --c-ink:     #191C21;
  --c-ink-2:   #3B3F45;
  --c-muted:   #696E75;
  --c-faint:   #9AA0A7;
  --c-surface:   #FFFFFF;
  --c-surface-2: #F3F4F6;
  --c-surface-3: #EBEDEF;
  --c-border:    #E6E8EB;
  --c-border-2:  #DADDE1;
  --c-success: #2E7D52;  --c-success-bg: #EAF3EE;
  --c-danger:  #B23B32;  --c-danger-bg:  #FBECEA;
  --c-warn:    #8A6D1F;  --c-warn-bg:    #F4EEDD;
  --c-info:    #8E0A12;  --c-info-bg:    #F6E9EA;
  --c-brand-orange-700: #B34F11;
  color: var(--c-ink);
}
}
