/* =========================================================
   base.css — CSS variables, reset, stepper, step visibility
   aeroplan.bg booking engine
   ========================================================= */

:root {
    --aeroplan-blue: #002955;
    --aeroplan-green: #18b239;
    --aeroplan-light-blue: #48abd6;
    --aeroplan-sky-blue: #1f74dc;
    --aeroplan-teal: #3ad5bb;
    --aeroplan-purple: #8142c5;
    --aeroplan-gray: #938d8d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Form elements do not inherit font-family from body by default in most browsers */
input, select, button, textarea, label {
    font-family: inherit;
    font-size: inherit;
}

html { overflow-x: clip; } /* clip ±100vw toolbar bg without breaking position:sticky */

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f3f4f6;
    color: #1f2937;
    padding: 20px;
}

.container { max-width: 1200px; margin: 0 auto; }

/* ===== Stepper Row (stepper + lang switcher on same line) ===== */
.stepper-row {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

/* ===== Stepper Bar ===== */
.stepper-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    gap: 0;
    position: relative;
}
.stepper-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #9ca3af;
    background: white;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
    cursor: default;
    white-space: nowrap;
}
.stepper-step .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.stepper-step.active {
    background: var(--aeroplan-blue);
    color: white;
    border-color: var(--aeroplan-blue);
}
.stepper-step.active .step-num {
    background: rgba(255,255,255,0.2);
    color: white;
}
.stepper-step.completed {
    background: #f0fdf4;
    color: var(--aeroplan-green);
    border-color: var(--aeroplan-green);
    cursor: pointer;
}
.stepper-step.completed:hover {
    background: #dcfce7;
}
.stepper-step.completed .step-num {
    background: var(--aeroplan-green);
    color: white;
}
.stepper-connector {
    width: 40px;
    height: 2px;
    background: #e5e7eb;
    flex-shrink: 0;
}
.stepper-connector.completed { background: var(--aeroplan-green); }

@media (max-width: 768px) {
    .stepper-bar { gap: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; }
    .stepper-step { padding: 7px 10px; font-size: 0.68rem; gap: 5px; }
    /* Mobile: only the active step shows its label — others just show the circle */
    .stepper-step .step-label { display: none; }
    .stepper-step.active .step-label { display: inline; white-space: nowrap; }
    .stepper-step .step-num { width: 24px; height: 24px; font-size: 0.72rem; }
    .stepper-connector { width: 14px; flex-shrink: 0; }
}
@media (max-width: 374px) {
    .stepper-step { padding: 6px 8px; }
    .stepper-step .step-num { width: 26px; height: 26px; }
    .stepper-connector { width: 10px; }
}

/* ===== Loading Overlay (search + booking) ===== */
#loading-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 41, 85, 0.6);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
}
#loading-overlay.visible { display: flex; }
.loading-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0,0,0,0.25);
    min-width: 280px;
    max-width: 360px;
}
.loading-plane {
    font-size: 2.8rem;
    color: var(--aeroplan-blue);
    margin-bottom: 18px;
    display: inline-block;
    animation: loadingRock 1.8s ease-in-out infinite;
}
@keyframes loadingRock {
    0%   { transform: rotate(-8deg) translateX(-5px); }
    50%  { transform: rotate( 8deg) translateX( 5px); }
    100% { transform: rotate(-8deg) translateX(-5px); }
}
.loading-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--aeroplan-blue);
    margin-bottom: 18px;
}
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-bottom: 18px;
}
.loading-dots span {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--aeroplan-blue);
    animation: loadingDot 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.22s; }
.loading-dots span:nth-child(3) { animation-delay: 0.44s; }
@keyframes loadingDot {
    0%, 100% { opacity: 0.25; transform: scale(0.75); }
    50%       { opacity: 1;    transform: scale(1.2);  }
}
.loading-msg {
    color: #6b7280;
    font-size: 0.85rem;
    min-height: 1.3em;
    transition: opacity 0.35s ease;
}
.loading-slow-note {
    margin-top: 16px;
    padding: 10px 14px;
    background: #f0f4f8;
    border-radius: 10px;
    color: #6b7280;
    font-size: 0.78rem;
    font-style: italic;
    line-height: 1.45;
    opacity: 0;
    transition: opacity 0.6s ease;
}

/* ===== Language Switcher ===== */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.lang-btn {
    padding: 4px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 50px;
    background: #fff;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.5px;
}
.lang-btn:hover {
    border-color: var(--aeroplan-blue);
    color: var(--aeroplan-blue);
}
.lang-btn.active {
    background: var(--aeroplan-blue);
    border-color: var(--aeroplan-blue);
    color: #fff;
}

/* ===== Step Sections (show/hide) ===== */
.step-section { display: none; animation: fadeIn 0.3s ease; }
.step-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }