/**
 * XLANE - Journey Planner & Itinerary Styles
 * Optimizat separat pentru Desktop și Mobile
 */

/* =========================================================================
   1. BOOKING FIELDS - DROPDOWNS & CUSTOM SEARCH
   ========================================================================= */
.booking-fields select {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--navy);
  background: transparent;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7581' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .25rem center;
  padding-right: 1.25rem;
}

.booking-fields select optgroup {
  font-weight: 700;
  color: #121e31;
}

.booking-fields select option {
  font-weight: normal;
  color: #1a2536;
  padding: .3rem .5rem;
}

/* Asigurăm că dropdown-urile și sugestiile autocomplete nu sunt tăiate de overflow */
.booking-fields {
  overflow: visible !important;
}

.booking-fields label {
  position: relative !important;
  overflow: visible !important;
}

.booking-fields label:nth-child(1) {
  z-index: 50;
}
.booking-fields label:nth-child(2) {
  z-index: 40;
}
.booking-fields label:nth-child(3) {
  z-index: 20;
}

.custom-location-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
}

.places-suggestions-menu {
  position: absolute;
  top: calc(100% + .55rem);
  left: -.7rem;
  right: -.7rem;
  width: calc(100% + 1.4rem);
  min-width: 290px;
  z-index: 999999 !important;
  margin: 0;
  padding: .35rem 0;
  list-style: none;
  background: #0b1424 !important;
  border: 1px solid rgba(0, 152, 255, 0.45) !important;
  border-radius: .55rem !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8) !important;
  max-height: 240px;
  overflow-y: auto;
}

.places-suggestion-item {
  padding: .55rem .8rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background .15s;
}

.places-suggestion-item:last-child {
  border-bottom: 0;
}

.places-suggestion-item:hover,
.places-suggestion-item.is-selected {
  background: rgba(0, 152, 255, 0.18);
}

.places-suggestion-item .suggestion-main {
  font-size: .78rem;
  font-weight: 600;
  color: #ffffff;
}

.places-suggestion-item .suggestion-sub {
  font-size: .65rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-switch-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid rgba(30,42,58,.2);
  border-radius: 50%;
  background: #f1f4f8;
  color: #6b7581;
  font-size: .65rem;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}

.btn-switch-back:hover {
  background: #e2e8f0;
  color: var(--navy);
}

/* =========================================================================
   2. ERROR & VALIDATION BANNER
   ========================================================================= */
.booking-error-banner {
  margin-top: .75rem;
  padding: .65rem .9rem;
  border-radius: .45rem;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.4;
  animation: fadeIn .25s ease-in-out;
}

/* =========================================================================
   3. HERO BOOKING CONTAINER WRAPPER
   ========================================================================= */
.hero-booking-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-booking-main {
  display: grid;
  grid-template-columns: .85fr 2.8fr auto;
  gap: 1rem;
  align-items: stretch;
}

/* =========================================================================
   4. ITINERARIU - CARD REZULTAT (DESKTOP DESIGN)
   ========================================================================= */
.journey-itinerary-card {
  margin-top: .75rem;
  padding: 1.15rem 1.35rem;
  border-radius: .75rem;
  background: linear-gradient(145deg, #0a1322 0%, #121e33 100%);
  border: 1px solid rgba(0, 152, 255, 0.22);
  box-shadow: 0 .9rem 2.2rem rgba(11, 18, 32, 0.22);
  color: #ffffff;
  animation: slideDown .3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Headerul de itinerariu */
.itinerary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-bottom: .95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.itinerary-route {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex: 1;
  min-width: 0;
}

.route-stop {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}

.route-stop .stop-dot {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.from-dot {
  background: #0098ff;
  box-shadow: 0 0 0 3px rgba(0, 152, 255, 0.22);
}

.to-dot {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.route-stop .stop-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.route-stop small {
  color: rgba(255, 255, 255, 0.55);
  font-size: .56rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}

.route-stop strong {
  color: #ffffff;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}

.route-arrow {
  color: #0098ff;
  font-size: .85rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Metrici: Distanță și Timp estimat cu trafic */
.itinerary-metrics {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;
}

.metric-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: .35rem .75rem;
  border-radius: .45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-pill-highlight {
  background: rgba(0, 152, 255, 0.12);
  border-color: rgba(0, 152, 255, 0.35);
}

.metric-label {
  font-size: .55rem;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}

.metric-val {
  font-size: .88rem;
  color: #ffffff;
  font-weight: 700;
}

.metric-pill-highlight .metric-val {
  color: #60a5fa;
}

/* Bara secundară: Dată/oră și notă trafic */
.itinerary-details-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0 .85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: .7rem;
  color: rgba(255, 255, 255, 0.72);
}

.itinerary-datetime-badge {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 500;
}

.traffic-badge-live, .traffic-badge-est {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: .66rem;
  padding: .15rem .45rem;
  border-radius: 99px;
  margin-right: .3rem;
}

.traffic-badge-live {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.traffic-badge-est {
  background: rgba(0, 152, 255, 0.2);
  color: #60a5fa;
}

.traffic-badge-limit {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

/* Rândul de configurare: Steppere Adulți, Copii, Bagaje & CTA */
.itinerary-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-top: .85rem;
}

.config-steppers-wrap {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem .65rem;
  border-radius: .45rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stepper-label {
  display: flex;
  flex-direction: column;
}

.stepper-label strong {
  font-size: .68rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: .02em;
}

.stepper-label small {
  font-size: .55rem;
  color: rgba(255, 255, 255, 0.5);
}

.stepper-ctrl {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: .2rem;
}

.stepper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: .95rem;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  transition: all .15s ease;
}

.stepper-btn:hover:not(:disabled) {
  background: var(--blue);
  border-color: var(--blue);
  transform: scale(1.06);
}

.stepper-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.stepper-value {
  display: inline-block;
  min-width: 1.15rem;
  text-align: center;
  font-size: .84rem;
  font-weight: 700;
  color: #ffffff;
}

.config-summary-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.capacity-hint {
  font-size: .67rem;
  color: rgba(255, 255, 255, 0.65);
}

.capacity-hint strong {
  color: #60a5fa;
}

.itinerary-cta-btn {
  min-height: 2.45rem;
  padding: .45rem 1.15rem;
  font-size: .74rem;
}

/* =========================================================================
   5. DESIGN SEPARAT PENTRU MOBIL (< 840px)
   ========================================================================= */
@media (max-width: 840px) {
  .hero-booking-main {
    display: block;
  }

  .places-suggestions-menu {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .flatpickr-calendar {
    max-width: calc(100vw - 1.5rem) !important;
  }

  .journey-itinerary-card {
    padding: .95rem;
    border-radius: .65rem;
  }

  /* Header compact pe mobil */
  .itinerary-header {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
    padding-bottom: .75rem;
  }

  .itinerary-route {
    flex-direction: column;
    align-items: stretch;
    gap: .45rem;
  }

  .route-stop strong {
    max-width: 100%;
    font-size: .78rem;
  }

  .route-arrow {
    display: none; /* ascuns pe mobil pentru a economisi spațiu vertical */
  }

  /* Metrici pe mobil: 2 coloane egale */
  .itinerary-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    width: 100%;
  }

  .metric-pill {
    align-items: center;
    text-align: center;
    padding: .4rem .5rem;
  }

  .metric-val {
    font-size: .82rem;
  }

  .itinerary-details-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    padding: .5rem 0 .7rem;
    font-size: .66rem;
  }

  /* Configurator pe mobil */
  .itinerary-config-row {
    flex-direction: column;
    align-items: stretch;
    gap: .85rem;
    padding-top: .75rem;
  }

  .config-steppers-wrap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .4rem;
    width: 100%;
  }

  .stepper-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: .45rem .25rem;
    gap: .35rem;
  }

  .stepper-ctrl {
    margin-left: 0;
    gap: .3rem;
  }

  .stepper-btn {
    width: 1.85rem; /* zonă de atingere generoasă */
    height: 1.85rem;
  }

  .config-summary-actions {
    flex-direction: column;
    align-items: stretch;
    gap: .65rem;
    width: 100%;
  }

  .capacity-hint {
    text-align: center;
    font-size: .64rem;
  }

  .itinerary-cta-btn {
    width: 100%;
    justify-content: center;
    min-height: 2.85rem;
    font-size: .8rem;
  }
}

/* =========================================================================
   6. CONTACT FORM & ALERT NOTICES
   ========================================================================= */
.form-alert {
  padding: .95rem 1.15rem;
  border-radius: .55rem;
  margin-bottom: 1.25rem;
  font-size: .82rem;
  line-height: 1.45;
  animation: fadeIn .3s ease;
}

.form-alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

.form-alert-success strong {
  display: block;
  font-size: .95rem;
  margin-bottom: .25rem;
  color: #34d399;
}

.form-alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.form-alert-error strong {
  display: block;
  margin-bottom: .35rem;
  color: #f87171;
}

.form-alert-error ul {
  margin: 0;
  padding-left: 1.25rem;
}

.form-alert-error li {
  margin-bottom: .2rem;
}

.form-sub-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-sub-row-3 {
    grid-template-columns: 1fr;
    gap: .75rem;
  }
}

/* =========================================================================
   7. FLATPICKR LUXURY DARK THEME OVERRIDE
   ========================================================================= */
.flatpickr-calendar {
  background: #0b1220 !important;
  border: 1px solid rgba(0, 152, 255, 0.3) !important;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.6) !important;
  border-radius: .75rem !important;
  color: #ffffff !important;
  font-family: inherit !important;
}

.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
  border-bottom-color: #0b1220 !important;
}

.flatpickr-months {
  background: #0e1728 !important;
  border-top-left-radius: .75rem;
  border-top-right-radius: .75rem;
  padding: .35rem 0;
}

.flatpickr-month {
  color: #ffffff !important;
  fill: #ffffff !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  color: #ffffff !important;
  font-weight: 700;
}

span.flatpickr-weekday {
  color: rgba(255, 255, 255, 0.45) !important;
  font-weight: 700;
  font-size: 80%;
}

.flatpickr-day {
  color: rgba(255, 255, 255, 0.85) !important;
  border-radius: .4rem !important;
  font-weight: 500;
}

.flatpickr-day:hover {
  background: rgba(0, 152, 255, 0.2) !important;
  border-color: transparent !important;
}

.flatpickr-day.today {
  border-color: #0098ff !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: #0098ff !important;
  border-color: #0098ff !important;
  color: #ffffff !important;
  font-weight: 700;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: rgba(255, 255, 255, 0.22) !important;
}

.flatpickr-time {
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: #0a111e !important;
  padding: .35rem 0 !important;
}

.flatpickr-time input.flatpickr-hour,
.flatpickr-time input.flatpickr-minute,
.flatpickr-time input.flatpickr-second,
.flatpickr-time input {
  background: #141f32 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  border-radius: .35rem !important;
  border: 1px solid rgba(0, 152, 255, 0.35) !important;
  margin: 0 .2rem !important;
}

.flatpickr-time input:hover,
.flatpickr-time input:focus {
  background: #1c2b44 !important;
  color: #60a5fa !important;
  border-color: #0098ff !important;
}

.flatpickr-time input::selection {
  background: #0098ff !important;
  color: #ffffff !important;
}

.flatpickr-time .flatpickr-time-separator {
  color: #ffffff !important;
  font-weight: 700 !important;
}

.flatpickr-time .flatpickr-am-pm {
  color: #0098ff !important;
}

.flatpickr-time .numInputWrapper span.arrowUp:after {
  border-bottom-color: #0098ff !important;
}

.flatpickr-time .numInputWrapper span.arrowDown:after {
  border-top-color: #0098ff !important;
}

.flatpickr-time .numInputWrapper span:hover {
  background: rgba(0, 152, 255, 0.25) !important;
}

/* Bara de confirmare OK pe desktop */
.flatpickr-confirm-bar {
  padding: .6rem .85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #0b1424;
  display: flex;
  border-bottom-left-radius: .75rem;
  border-bottom-right-radius: .75rem;
}

.flatpickr-confirm-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .5rem 1rem;
  background: var(--blue);
  color: #ffffff;
  border: 0;
  border-radius: .4rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

.flatpickr-confirm-btn:hover {
  background: #0080db;
  transform: translateY(-1px);
}

.flatpickr-confirm-btn:active {
  transform: translateY(0);
}

/* =========================================================================
   7. HIDDEN / REVEALED REQUEST SECTION & FORM VALIDATIONS
   ========================================================================= */
.booking-section-hidden {
  display: none !important;
}

.request.is-revealed {
  display: block !important;
  animation: fadeInRequest 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInRequest {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quote-form input[readonly].form-input-readonly {
  background: rgba(18, 30, 49, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
  cursor: default;
}

.quote-form input.input-error,
.quote-form select.input-error,
.quote-form textarea.input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
}

.field-error-text {
  display: block;
  font-size: 0.75rem;
  color: #f87171;
  margin-top: 0.25rem;
}

/* =========================================================================
   8. SUCCESS OVERLAY MODAL (DESKTOP & MOBILE)
   ========================================================================= */
.booking-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.booking-success-overlay.is-closing {
  opacity: 0;
  pointer-events: none;
}

.booking-success-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.booking-success-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #0d1524;
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 25px rgba(212, 175, 55, 0.12);
  border-radius: 1rem;
  padding: 2.2rem 2rem 1.8rem 2rem;
  text-align: center;
  z-index: 1;
  animation: scaleInSuccess 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleInSuccess {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.success-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.success-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.1rem auto;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 0.6rem 0;
}

.success-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #cbd5e1;
  margin: 0 0 1.4rem 0;
}

.success-timer-wrap {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1.3rem;
}

.success-timer-text {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 0.45rem;
}

.success-timer-text b {
  color: #34d399;
}

.success-timer-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.success-timer-progress {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #34d399, #d4af37);
  transition: width 0.1s linear;
}

.success-ok-btn {
  width: 100%;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .booking-success-card {
    padding: 1.8rem 1.3rem 1.4rem 1.3rem;
    border-radius: 0.85rem;
  }
  .success-title {
    font-size: 1.2rem;
  }
  .success-text {
    font-size: 0.88rem;
  }
}

