/**
 * Airport Transfer Booking — Frontend Styles
 * Mobile-first redesign with photo thumbnails, compact cards, horizontal steps
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=DM+Serif+Display&display=swap');

/* ==========================================================================
   Variables
   ========================================================================== */

.atb-booking-form {
    --navy:        #0c3547;
    --navy-mid:    #164e63;
    --sky:         #0ea5e9;
    --sky-light:   #e0f2fe;
    --green:       #059669;
    --green-light: #d1fae5;
    --amber:       #d97706;
    --orange:      #f97316;
    --slate-900:   #0f172a;
    --slate-700:   #334155;
    --slate-500:   #64748b;
    --slate-400:   #94a3b8;
    --slate-300:   #cbd5e1;
    --slate-200:   #e2e8f0;
    --slate-100:   #f1f5f9;
    --slate-50:    #f8fafc;
    --white:       #ffffff;
    --radius:      10px;
    --radius-sm:   7px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
    --shadow:      0 4px 16px rgba(0,0,0,0.08);
    --shadow-md:   0 8px 30px rgba(0,0,0,0.10);
    --ease:        cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Booking Form Container
   ========================================================================== */

.atb-booking-form {
    max-width: 820px;
    margin: 0 auto;
    padding: 20px 32px 36px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--slate-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.atb-booking-form h2 {
    margin: 0 0 5px;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 26px;
    font-weight: 400;
    color: var(--navy);
    letter-spacing: -0.3px;
}

.atb-booking-form .atb-subtitle {
    margin: 0 0 28px;
    font-size: 14px;
    color: var(--slate-500);
}

/* ==========================================================================
   Progress Steps — Horizontal, stays horizontal on all screen sizes
   ========================================================================== */

.atb-form-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0;
    list-style: none;
    position: relative;
}

/* Full-width connector line behind circles */
.atb-form-steps::before {
    content: '';
    position: absolute;
    top: 17px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--slate-200);
    z-index: 0;
}

.atb-form-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.atb-form-step::before {
    display: none;
}

.atb-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--slate-300);
    color: var(--slate-400);
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 7px;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
                color 0.25s var(--ease), box-shadow 0.25s var(--ease);
    position: relative;
    z-index: 1;
}

/* Active step — sky blue highlight */
.atb-form-step.active .atb-step-number {
    background: var(--sky);
    border-color: var(--sky);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18);
}

/* Completed step — navy with checkmark */
.atb-form-step.completed .atb-step-number {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
    font-size: 0;
}

.atb-form-step.completed .atb-step-number::after {
    content: '\2713';
    font-size: 14px;
    font-weight: 700;
}

.atb-step-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--slate-400);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-align: center;
    transition: color 0.25s var(--ease);
}

.atb-form-step.active .atb-step-label   { color: var(--sky);   }
.atb-form-step.completed .atb-step-label { color: var(--navy); }

/* ==========================================================================
   Form Sections
   ========================================================================== */

.atb-form-section {
    display: none;
    animation: fadeUp 0.3s var(--ease);
}

.atb-form-section.active { display: block; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.atb-section-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 19px;
    font-weight: 400;
    margin: 0 0 18px;
    color: var(--navy);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--slate-100);
}

/* ==========================================================================
   Route Cards — Photo thumbnail, grid layout, no repeated text, radio on right
   ========================================================================== */

.atb-route-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.atb-route-option {
    position: relative;
    cursor: pointer;
}

.atb-route-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Grid: [photo col] [text col grows] [radio col] */
.atb-route-card {
    display: grid;
    grid-template-columns: 130px 1fr 30px;
    grid-template-rows: auto auto;
    grid-template-areas:
        "thumb  name  dot"
        "thumb  info  dot";
    gap: 0 12px;
    padding-right: 14px;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius);
    background: var(--white);
    overflow: hidden;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    cursor: pointer;
    min-height: 70px;
    align-items: center;
}

.atb-route-option input[type="radio"]:checked + .atb-route-card {
    border-color: var(--sky);
    background: var(--sky-light);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.atb-route-card:hover {
    border-color: var(--sky);
    box-shadow: var(--shadow-sm);
}

/* Photo thumbnail — grid area, flush left, full card height */
.atb-route-icon {
    grid-area: thumb;
    grid-row: 1 / 3;
    width: 130px;
    align-self: stretch;
    background-color: var(--slate-200);
    background-size: cover;
    background-position: center;
    font-size: 0;
    color: transparent;
}

/* Different photo per route card */
.atb-route-option:nth-child(1) .atb-route-icon {
    background-image: url('https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=160&q=80');
}
.atb-route-option:nth-child(2) .atb-route-icon {
    background-image: url('https://images.unsplash.com/photo-1559827260-dc66d52bef19?w=160&q=80');
}
.atb-route-option:nth-child(3) .atb-route-icon {
    background-image: url('https://images.unsplash.com/photo-1569288035052-a2e2e0c7d50a?w=160&q=80');
}
.atb-route-option:nth-child(4) .atb-route-icon {
    background-image: url('https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=160&q=80');
}

/* Route name */
.atb-route-name {
    grid-area: name;
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-900);
    align-self: end;
    padding-top: 13px;
    padding-bottom: 2px;
    line-height: 1.3;
}

/* Route details — hide first child (origin→dest, repeats route_name), show only distance pill */
.atb-route-details {
    grid-area: info;
    align-self: start;
    padding-bottom: 13px;
    padding-top: 3px;
}

.atb-route-details div:first-child {
    display: none;   /* hides the repeated "Origin → Destination" line */
}

.atb-route-details div:last-child {
    display: inline-flex;
    align-items: center;
    background: var(--slate-100);
    color: var(--slate-500);
    font-size: 11.5px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.atb-route-option input[type="radio"]:checked + .atb-route-card .atb-route-details div:last-child {
    background: rgba(14, 165, 233, 0.14);
    color: var(--navy-mid);
}

/* Radio dot — rightmost grid column, vertically centered */
.atb-route-card::after {
    content: '';
    grid-area: dot;
    grid-row: 1 / 3;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--slate-300);
    background: var(--white);
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    align-self: center;
    justify-self: center;
}

.atb-route-option input[type="radio"]:checked + .atb-route-card::after {
    background: var(--sky);
    border-color: var(--sky);
    box-shadow: inset 0 0 0 3px var(--white);
}

/* ==========================================================================
   Vehicle Cards — Photo thumbnail, compact horizontal grid
   ========================================================================== */

.atb-vehicle-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.atb-vehicle-option {
    position: relative;
    cursor: pointer;
}

.atb-vehicle-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Grid: [photo] [name / capacity stacked] [price] [radio] */
.atb-vehicle-card {
    display: grid;
    grid-template-columns: 130px 1fr auto 30px;
    grid-template-rows: auto auto;
    grid-template-areas:
        "photo  name      price  dot"
        "photo  capacity  price  dot";
    gap: 0 12px;
    padding-right: 14px;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius);
    background: var(--white);
    overflow: hidden;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    cursor: pointer;
    min-height: 70px;
    align-items: center;
}

.atb-vehicle-option input[type="radio"]:checked + .atb-vehicle-card {
    border-color: var(--green);
    background: var(--green-light);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.atb-vehicle-card:hover {
    border-color: var(--green);
    box-shadow: var(--shadow-sm);
}

/* Photo thumbnail */
.atb-vehicle-icon {
    grid-area: photo;
    grid-row: 1 / 3;
    width: 130px;
    align-self: stretch;
    background-color: var(--slate-200);
    background-size: cover;
    background-position: center;
    font-size: 0;
    color: transparent;
}

/* Vehicle type images are now set dynamically via JS */

.atb-vehicle-name {
    grid-area: name;
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-900);
    align-self: end;
    padding-top: 13px;
    padding-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atb-vehicle-capacity {
    grid-area: capacity;
    font-size: 12px;
    color: var(--slate-500);
    align-self: start;
    padding-bottom: 13px;
    padding-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atb-vehicle-price {
    grid-area: price;
    grid-row: 1 / 3;
    align-self: center;
    font-size: 17px;
    font-weight: 700;
    color: var(--amber);
    white-space: nowrap;
    text-align: right;
    letter-spacing: -0.3px;
}

.atb-vehicle-price .currency {
    font-size: 11px;
    font-weight: 600;
    vertical-align: super;
    line-height: 0;
    margin-right: 1px;
}

/* Radio dot */
.atb-vehicle-card::after {
    content: '';
    grid-area: dot;
    grid-row: 1 / 3;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--slate-300);
    background: var(--white);
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    align-self: center;
    justify-self: center;
}

.atb-vehicle-option input[type="radio"]:checked + .atb-vehicle-card::after {
    background: var(--green);
    border-color: var(--green);
    box-shadow: inset 0 0 0 3px var(--white);
}

/* ==========================================================================
   Form Fields
   ========================================================================== */

.atb-form-group { margin-bottom: 20px; }

.atb-form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--slate-700);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.atb-form-label small {
    font-size: 12px;
    color: var(--slate-400);
    text-transform: none;
    font-weight: 400;
    letter-spacing: 0;
    margin-left: 4px;
}

.atb-form-label .required { color: #ef4444; margin-left: 2px; }

.atb-form-control {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;    /* 16px prevents iOS zoom, 15px acceptable */
    font-family: 'DM Sans', sans-serif;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--slate-900);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.atb-form-control:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.atb-form-control::placeholder { color: var(--slate-300); }
.atb-form-control.error         { border-color: #ef4444; }
.atb-form-control.error:focus   { box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }

.atb-error-message {
    display: none;
    margin-top: 5px;
    font-size: 12px;
    color: #ef4444;
}

.atb-form-control.error + .atb-error-message { display: block; }

textarea.atb-form-control {
    min-height: 80px;
    resize: vertical;
    line-height: 1.5;
}

.atb-form-row { display: flex; gap: 16px; }
.atb-form-col { flex: 1; min-width: 0; }

/* ==========================================================================
   Booking Summary
   ========================================================================== */

.atb-booking-summary {
    background: var(--slate-50);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius);
    padding: 22px;
    margin: 24px 0;
}

.atb-summary-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 17px;
    font-weight: 400;
    margin: 0 0 16px;
    color: var(--navy);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--slate-200);
}

.atb-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--slate-100);
}

.atb-summary-item:last-child { border-bottom: none; }

.atb-summary-label { font-size: 13px; color: var(--slate-500); font-weight: 500; flex-shrink: 0; }
.atb-summary-value { font-size: 13px; font-weight: 600; color: var(--slate-900); text-align: right; line-height: 1.6; }

.atb-summary-total {
    margin-top: 12px;
    padding-top: 14px !important;
    border-top: 2px solid var(--navy) !important;
    border-bottom: none !important;
}

.atb-summary-total .atb-summary-label { font-size: 15px; font-weight: 700; color: var(--navy); }
.atb-summary-total .atb-summary-value { font-size: 22px; font-weight: 700; color: var(--amber); letter-spacing: -0.5px; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.atb-form-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--slate-100);
}

.atb-btn {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.atb-btn-primary {
    background: linear-gradient(135deg, var(--sky) 0%, #0284c7 100%);
    color: var(--white);
    flex: 1;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
}

.atb-btn-primary:hover, .atb-btn-primary:active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35);
}

.atb-btn-submit {
    background: linear-gradient(135deg, var(--orange) 0%, #ea580c 100%);
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.3);
}

.atb-btn-submit:hover, .atb-btn-submit:active {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
    transform: translateY(-1px);
}

.atb-btn-secondary {
    background: var(--white);
    color: var(--slate-700);
    border: 1.5px solid var(--slate-200);
    flex: none;
    padding: 13px 22px;
}

.atb-btn-secondary:hover, .atb-btn-secondary:active {
    background: var(--slate-50);
    border-color: var(--slate-400);
    color: var(--slate-900);
}

.atb-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.atb-btn.loading { pointer-events: none; padding-right: 46px; position: relative; }

.atb-btn.loading::after {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    top: 50%; right: 16px;
    margin-top: -7px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Loading & Messages
   ========================================================================== */

.atb-loading-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(12, 53, 71, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.atb-loading-overlay.active { display: flex; }

.atb-spinner {
    width: 42px; height: 42px;
    border: 3px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}

.atb-loading {
    font-size: 14px;
    color: var(--slate-400);
    text-align: center;
    padding: 28px 0;
    font-style: italic;
}

.atb-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: messageSlideIn 0.3s var(--ease), messageFadeOut 0.5s var(--ease) 4.5s forwards;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes messageFadeOut {
    to { opacity: 0; transform: translateY(-10px); pointer-events: none; }
}

.atb-message-success { background: var(--green-light); border-left: 3px solid var(--green);  color: #065f46; }
.atb-message-error   { background: #fef2f2;           border-left: 3px solid #ef4444;        color: #991b1b; }
.atb-message-warning { background: #fef3c7;           border-left: 3px solid var(--amber);   color: #92400e; }
.atb-message-info    { background: var(--sky-light);  border-left: 3px solid var(--sky);     color: #0c4a6e; }

/* T&C checkbox */
.atb-form-group label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--slate-700);
    cursor: pointer;
    gap: 8px;
}

.atb-form-group label input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: var(--sky);
    flex-shrink: 0;
    cursor: pointer;
}

.atb-form-group label a { color: var(--sky); text-decoration: none; font-weight: 600; }
.atb-form-group label a:hover { text-decoration: underline; }

/* ==========================================================================
   Mobile — Primary breakpoint
   ========================================================================== */

@media (max-width: 640px) {

    .atb-booking-form {
        padding: 16px 16px 28px;
        border-radius: 10px;
        box-shadow: var(--shadow);
    }

    .atb-booking-form h2 { font-size: 21px; }

    /* Steps stay horizontal — just smaller */
    .atb-form-steps { margin-bottom: 24px; }
    .atb-form-steps::before { top: 14px; }

    .atb-step-number {
        width: 30px; height: 30px;
        font-size: 12px;
        margin-bottom: 6px;
    }

    .atb-step-label { font-size: 10px; }

    /* Smaller thumbnails on phones */
    .atb-route-card {
        grid-template-columns: 60px 1fr 26px;
        min-height: 64px;
    }

    .atb-route-icon { width: 60px; }

    .atb-vehicle-card {
        grid-template-columns: 60px 1fr auto 26px;
        min-height: 64px;
    }

    .atb-vehicle-icon { width: 100px; }

    .atb-vehicle-price  { font-size: 15px; }
    .atb-vehicle-name   { font-size: 13.5px; }
    .atb-vehicle-capacity { font-size: 11.5px; }

    /* Stack 2-col form rows */
    .atb-form-row { flex-direction: column; gap: 0; }

    /* Buttons stack vertically, large tap targets */
    .atb-form-actions { flex-direction: column-reverse; gap: 10px; }

    .atb-btn, .atb-btn-secondary {
        width: 100%;
        padding: 15px 20px;
        font-size: 15px;
    }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .atb-form-steps, .atb-form-actions { display: none; }
    .atb-booking-form { box-shadow: none; border: 1px solid var(--slate-300); }
}