/**
 * Waiver Modal Styling
 * Advanced Form Builder - Moraine Lake Sunrise Shuttle
 *
 * Path: assets/css/afb-waiver-modal.css
 */

/* ===================================================================
   MODAL OVERLAY
   =================================================================== */

.afb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: afb-fadeIn 0.3s ease;
}

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

/* ===================================================================
   MODAL CONTAINER
   =================================================================== */

.afb-modal-container {
    background: #0B3C4A;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: afb-slideUp 0.3s ease;
}

@keyframes afb-slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===================================================================
   MODAL HEADER
   =================================================================== */

.afb-modal-header {
    padding: 30px 30px 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.afb-modal-header h2 {
    margin: 0 0 15px 0;
    font-size: 26px;
    font-weight: 700;
    color: #E59E2C;
    line-height: 1.3;
}

.afb-modal-progress {
    margin-top: 15px;
}

.afb-progress-text {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    font-weight: 500;
}

.afb-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.afb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #E59E2C 0%, #C48724 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* ===================================================================
   MODAL BODY
   =================================================================== */

.afb-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Custom scrollbar */
.afb-modal-body::-webkit-scrollbar {
    width: 8px;
}

.afb-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.afb-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.afb-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===================================================================
   BOOKING POLICY CONTENT
   =================================================================== */

.afb-policy-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.afb-policy-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
    /* FIX 2026-02-24: P1.3 - Reduce max-height to ensure checkbox is visible without scrolling */
    max-height: 350px;
}

.afb-policy-scroll h3 {
    font-size: 20px;
    color: #E59E2C;
    margin: 0 0 20px 0;
    font-weight: 600;
}

.afb-policy-scroll h4 {
    font-size: 16px;
    color: #E59E2C;
    margin: 25px 0 10px 0;
    font-weight: 600;
}

.afb-policy-scroll p {
    font-size: 15px;
    line-height: 1.7;
    color: #ffffff;
    margin: 0 0 12px 0;
}

.afb-policy-scroll ul {
    margin: 10px 0 15px 20px;
    padding: 0;
}

.afb-policy-scroll li {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.afb-policy-acceptance {
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    margin-top: 10px;
    /* FIX 2026-02-24: P1.3 - Prevent checkbox area from being squeezed off-screen */
    flex-shrink: 0;
}

/* ===================================================================
   WAIVER CONTENT
   =================================================================== */

.afb-waiver-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.afb-waiver-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
    max-height: 350px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.afb-waiver-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.afb-waiver-header h3 {
    font-size: 22px;
    color: #E59E2C;
    margin: 0 0 10px 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.afb-waiver-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin: 5px 0;
    font-weight: 500;
}

.afb-waiver-company {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 5px 0 0 0;
}

.afb-waiver-section {
    margin-bottom: 25px;
}

.afb-waiver-section h4 {
    font-size: 16px;
    color: #E59E2C;
    margin: 0 0 12px 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.afb-waiver-section p {
    font-size: 14px;
    line-height: 1.7;
    color: #ffffff;
    margin: 0 0 12px 0;
}

.afb-waiver-section ul {
    margin: 10px 0 15px 20px;
    padding: 0;
}

.afb-waiver-section li {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.afb-waiver-section strong {
    color: #E59E2C;
    font-weight: 600;
}

.afb-waiver-legal-notice {
    background: rgba(229, 158, 44, 0.15);
    border: 2px solid #E59E2C;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.afb-waiver-legal-notice p {
    margin: 0;
    font-size: 14px;
    color: #E59E2C;
    font-weight: 600;
}

/* ===================================================================
   SIGNATURE SECTION
   =================================================================== */

.afb-signature-section {
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.afb-signature-section h4 {
    font-size: 18px;
    color: #E59E2C;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.afb-signature-instructions {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 20px 0;
}

.afb-form-group {
    margin-bottom: 20px;
}

.afb-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.afb-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.afb-input:focus {
    outline: none;
    border-color: #E59E2C;
    box-shadow: 0 0 0 3px rgba(229, 158, 44, 0.2);
}

.afb-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.afb-form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.afb-waiver-acceptance {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.afb-waiver-meta {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.afb-meta-info {
    font-size: 13px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.afb-meta-info strong {
    color: #E59E2C;
    font-weight: 600;
}

/* ===================================================================
   CHECKBOX STYLING
   =================================================================== */

.afb-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
}

.afb-checkbox {
    width: 20px;
    height: 20px;
    margin: 2px 12px 0 0;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #E59E2C;
}

.afb-checkbox-label span {
    flex: 1;
}

/* ===================================================================
   MODAL FOOTER
   =================================================================== */

.afb-modal-footer {
    padding: 20px 30px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

/* ===================================================================
   BUTTONS
   =================================================================== */

.afb-btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.afb-btn-primary {
    background: linear-gradient(135deg, #E59E2C 0%, #C48724 100%);
    color: #0B3C4A;
    box-shadow: 0 2px 8px rgba(229, 158, 44, 0.3);
    font-weight: 700;
}

.afb-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #C48724 0%, #A67120 100%);
    box-shadow: 0 4px 12px rgba(229, 158, 44, 0.4);
    transform: translateY(-1px);
}

.afb-btn-primary:disabled {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    box-shadow: none;
}

.afb-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.afb-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===================================================================
   RESPONSIVE DESIGN
   =================================================================== */

@media (max-width: 768px) {
    .afb-modal-overlay {
        padding: 10px;
    }

    .afb-modal-container {
        max-height: 95vh;
    }

    .afb-modal-header {
        padding: 20px 20px 15px;
    }

    .afb-modal-header h2 {
        font-size: 22px;
    }

    .afb-modal-body {
        padding: 20px;
    }

    .afb-policy-scroll,
    .afb-waiver-scroll {
        max-height: 300px;
    }

    .afb-modal-footer {
        padding: 15px 20px;
        flex-direction: column-reverse;
    }

    .afb-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .afb-modal-header h2 {
        font-size: 20px;
    }

    .afb-policy-scroll,
    .afb-waiver-scroll {
        max-height: 250px;
    }

    .afb-policy-scroll h3 {
        font-size: 18px;
    }

    .afb-waiver-header h3 {
        font-size: 18px;
    }
}

/* ===================================================================
   PRINT STYLES (for waiver PDF generation)
   =================================================================== */

@media print {
    .afb-modal-overlay {
        background: white;
        position: static;
    }

    .afb-modal-container {
        box-shadow: none;
        max-height: none;
    }

    .afb-modal-footer,
    .afb-btn {
        display: none;
    }

    .afb-waiver-scroll,
    .afb-policy-scroll {
        max-height: none;
        overflow: visible;
    }
}

/* ===================================================================
   POLICY/WAIVER MODAL OVERRIDES (Feb 19, 2026)
   - Remove yellow progress header
   - Fix double scrollbar
   - Fix readonly input styling
   =================================================================== */

/* Hide the yellow progress header bar entirely */
.afb-modal-overlay .afb-modal-header,
.afb-modal-overlay .afb-booking-modal-header {
    display: none !important;
}

/* FIX 2026-02-24: P1.3 - Removed aggressive override that disabled scrolling entirely.
   Now using controlled max-height (350px) in main styles to ensure checkbox is visible.
   Scroll is still enabled within the policy/waiver content area. */
/* OLD CODE REMOVED:
.afb-policy-scroll {
    overflow-y: visible !important;
    max-height: none !important;
}

.afb-waiver-scroll {
    overflow-y: visible !important;
    max-height: none !important;
}
*/

/* Readonly inputs (like Full Legal Name) should match other inputs */
.afb-input[readonly],
.afb-input:read-only,
.afb-form-group input[readonly] {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    opacity: 0.8;
}

/* ===================================================================
   STEP ICONS - Horizontal Navigation (Jan 8 - with back/close buttons)
   =================================================================== */

/* Navigation container with back, steps, and close */
.afb-waiver-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #0B3C4A;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.75rem;
}

/* Back and close buttons */
.afb-waiver-nav-back,
.afb-waiver-nav-close {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.afb-waiver-nav-back:hover {
    border-color: #E59E2C;
    color: #E59E2C;
    background: rgba(229, 158, 44, 0.1);
}

.afb-waiver-nav-close {
    color: #E59E2C !important;  /* 2026-02-18: Golden orange X close button */
    border-color: #E59E2C;
}

.afb-waiver-nav-close:hover {
    color: #C48724 !important;  /* Darker gold on hover */
    border-color: #C48724;
    background: rgba(229, 158, 44, 0.1);
    transform: scale(1.1);
}

.afb-waiver-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0;
}

.afb-waiver-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.75rem;
    cursor: default;
    transition: all 0.3s ease;
}

.afb-waiver-step[data-goto-page],
.afb-waiver-step[data-goto-step] {
    cursor: pointer;
}

.afb-waiver-step-icon {
    font-size: 1.5rem;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.afb-waiver-step-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s;
    font-weight: 500;
}

.afb-waiver-step--active .afb-waiver-step-icon {
    opacity: 1;
}

.afb-waiver-step--active .afb-waiver-step-label {
    color: #E59E2C;
    font-weight: 600;
}

.afb-waiver-step--completed {
    cursor: pointer;
}

.afb-waiver-step--completed:hover .afb-waiver-step-icon {
    opacity: 1;
    transform: scale(1.1);
}

.afb-waiver-step--completed .afb-waiver-step-icon {
    opacity: 0.8;
}

.afb-waiver-step--completed .afb-waiver-step-label {
    color: rgba(255, 255, 255, 0.7);
}

.afb-waiver-step--pending .afb-waiver-step-icon {
    opacity: 0.3;
}

.afb-waiver-step--pending .afb-waiver-step-label {
    color: rgba(255, 255, 255, 0.3);
}

.afb-waiver-step-line {
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s;
}

.afb-waiver-step-line--completed {
    background: #E59E2C;
}

.afb-waiver-step-line--pending {
    background: rgba(255, 255, 255, 0.2);
}
/* ===================================================================
   TASK-288: WAIVER STEP UX IMPROVEMENTS
   Added: 2026-04-16
   Terminal: T2 (Website Design)
   Purpose: Better visual feedback for required fields and errors
   =================================================================== */

/* -------------------------------------------------------------------
   1. REQUIRED FIELD ASTERISKS
   Red asterisks on Initials, DOB, and Acknowledgment labels
   ------------------------------------------------------------------- */

/* Required asterisk for signature section labels */
.afb-signature-section .afb-form-group label::after,
.afb-waiver-acceptance .afb-checkbox-label::after {
    content: " *";
    color: #D64545;
    font-weight: 700;
}

/* Alternative: Target specific labels by text content using attribute selectors */
/* Applied via parent .afb-waiver-required class that JS can add */
.afb-waiver-required label::after {
    content: " *";
    color: #D64545;
    font-weight: 700;
}

/* -------------------------------------------------------------------
   2. VALIDATION ERROR HIGHLIGHTING
   Red border on empty required fields when validation fails
   ------------------------------------------------------------------- */

/* Invalid input highlighting for waiver modal */
.afb-modal-overlay .afb-input.afb-field-invalid,
.afb-modal-overlay .afb-form-group.has-error .afb-input {
    border-color: #D64545 !important;
    background-color: rgba(214, 69, 69, 0.1) !important;
    animation: afb-waiver-shake 0.5s ease-in-out;
}

.afb-modal-overlay .afb-input.afb-field-invalid:focus {
    border-color: #D64545 !important;
    box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.25) !important;
}

/* Invalid checkbox highlighting */
.afb-modal-overlay .afb-checkbox.afb-field-invalid,
.afb-waiver-acceptance.has-error .afb-checkbox {
    outline: 2px solid #D64545;
    outline-offset: 2px;
}

/* Label turns red for invalid fields */
.afb-modal-overlay .afb-form-group.has-error label {
    color: #D64545 !important;
}

/* Shake animation for waiver fields */
@keyframes afb-waiver-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* -------------------------------------------------------------------
   3. ERROR MESSAGE VISIBILITY
   Prominent error message styling using MLSS brand red
   ------------------------------------------------------------------- */

/* Validation error popup in waiver modal */
.afb-modal-overlay .afb-validation-error,
.afb-modal-overlay .afb-waiver-error-message {
    background: rgba(214, 69, 69, 0.15);
    border: 2px solid #D64545;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
    color: #ffffff;
    font-weight: 500;
    text-align: center;
}

.afb-modal-overlay .afb-validation-error::before {
    content: "⚠️ ";
    font-size: 1.1em;
}

/* Inline field error messages */
.afb-modal-overlay .afb-field-error-msg {
    display: block;
    color: #D64545;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 6px;
    padding-left: 2px;
}

/* -------------------------------------------------------------------
   4. HELPER TEXT STYLING
   Contextual hints below fields
   ------------------------------------------------------------------- */

/* Helper text styling */
.afb-modal-overlay .afb-field-helper,
.afb-modal-overlay .afb-waiver-helper {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 6px;
    font-style: italic;
}

/* DOB helper - "Must be 18 or older to sign waiver" */
.afb-signature-section .afb-form-group:has(input[type="date"]) .afb-field-helper,
.afb-signature-section .afb-dob-helper {
    color: rgba(229, 158, 44, 0.9);
    font-weight: 500;
}

/* Initials helper - "Enter your initials (e.g., JD)" */
.afb-signature-section .afb-form-group:has(input[placeholder*="nitial"]) .afb-field-helper,
.afb-signature-section .afb-initials-helper {
    color: rgba(255, 255, 255, 0.7);
}

/* -------------------------------------------------------------------
   5. MOBILE RESPONSIVE ADJUSTMENTS
   ------------------------------------------------------------------- */

@media (max-width: 480px) {
    .afb-modal-overlay .afb-validation-error {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .afb-modal-overlay .afb-field-helper {
        font-size: 0.7rem;
    }
}

/* ===================================================================
   TASK-289: REFINED VALIDATION GLOW EFFECT
   ===================================================================
   Refinement of TASK-288 glow per industry standards

   Changes from TASK-288:
   - Shadow spread: 35px → 8px max (industry standard)
   - Animation: 1.5s infinite → 0.8s x2 cycles (not overwhelming)
   - Shake + Glow: Now sequential, not simultaneous
   - Added prefers-reduced-motion support (accessibility)

   Sources:
   - Nielsen Norman Group: "subtle pulse, don't abuse animation"
   - Material Design: 0.3s duration, 4px spread
   - Bootstrap: 0.25rem (4px) spread
   =================================================================== */

/* Refined glowing pulse - industry standard (8px max, 2 cycles) */
@keyframes afb-glow-pulse {
    0%, 100% {
        box-shadow: 0 0 2px rgba(214, 69, 69, 0.4),
                    0 0 4px rgba(214, 69, 69, 0.2);
    }
    50% {
        box-shadow: 0 0 4px rgba(214, 69, 69, 0.6),
                    0 0 8px rgba(214, 69, 69, 0.3);
    }
}

/* Apply to invalid inputs - SEQUENTIAL: shake first (0.5s), then glow (0.8s x2) */
.afb-modal-overlay .afb-input.afb-field-invalid,
.afb-modal-overlay .afb-form-group.has-error .afb-input,
.afb-signature-section .afb-input.afb-field-invalid {
    animation:
        afb-waiver-shake 0.5s ease-out,
        afb-glow-pulse 0.8s ease-out 0.5s 2;
    border-color: #D64545 !important;
    background-color: rgba(214, 69, 69, 0.15) !important;
}

/* Glowing checkbox when invalid - subtle glow only */
.afb-modal-overlay .afb-checkbox.afb-field-invalid,
.afb-waiver-acceptance.has-error .afb-checkbox,
.afb-waiver-acceptance.has-error input[type="checkbox"] {
    outline: 2px solid #D64545;
    outline-offset: 3px;
    animation: afb-glow-pulse 0.8s ease-out 2;
    border-radius: 3px;
}

/* Acceptance box glow when checkbox not checked */
.afb-waiver-acceptance.has-error {
    background: rgba(214, 69, 69, 0.1) !important;
    border: 2px solid #D64545 !important;
    animation: afb-glow-pulse 0.8s ease-out 2;
}

/* Stop animation when field is focused */
.afb-modal-overlay .afb-input.afb-field-invalid:focus {
    animation: none;
    box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.3) !important;
}

/* ACCESSIBILITY: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .afb-modal-overlay .afb-input.afb-field-invalid,
    .afb-modal-overlay .afb-form-group.has-error .afb-input,
    .afb-signature-section .afb-input.afb-field-invalid,
    .afb-modal-overlay .afb-checkbox.afb-field-invalid,
    .afb-waiver-acceptance.has-error .afb-checkbox,
    .afb-waiver-acceptance.has-error input[type="checkbox"],
    .afb-waiver-acceptance.has-error {
        animation: none !important;
        border-color: #D64545 !important;
    }
}

/* =====================================================================
   T2 iPhone MOBILE POLISH PATCH — STAGING137 ONLY — 2026-06-25
   Directive: STAGING137_CSS_FIX_REQUEST (CEO/GM). CSS-ONLY, no JS/logic.
   Fixes (<=480px):
     D1  .afb-waiver-steps was flex:1 + min-width:auto, so the rail (~537px)
         pushed #afb-waiver-nav-close off the right edge (offRight 379px @320).
         Now the rail shrinks (min-width:0) and scrolls internally; the
         back/close controls (flex:0 0 auto) stay on-screen. Labels hidden.
     D3  The policy & waiver pages nested a capped inner scroll
         (.afb-policy-scroll / .afb-waiver-scroll, max-height ~261px) inside
         the already-short modal body, burying the acceptance checkbox and
         signature fields below the fold / behind the in-flow footer.
         On mobile we collapse the inner scroll so there is ONE natural
         scroll, making the checkbox + signature clearly reachable.
         (Verified: no JS scroll-gating references these elements.)
   REVERSIBLE: delete this block to fully revert.
   ===================================================================== */
@media (max-width: 480px) {
    /* D1 — step rail */
    .afb-waiver-nav-container { gap: 0.4rem; }

    .afb-waiver-steps {
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .afb-waiver-steps::-webkit-scrollbar { display: none; }

    .afb-waiver-step { flex: 0 0 auto; padding: 0 0.4rem; }
    .afb-waiver-step-label { display: none; }
    .afb-waiver-step-icon  { font-size: 1.15rem; }
    .afb-waiver-step-line  { width: 10px; }

    .afb-waiver-nav-back,
    .afb-waiver-nav-close {
        flex: 0 0 auto;
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }

    /* D3 — collapse nested inner scroll -> single natural scroll.
       !important is REQUIRED: afb-inline-booking-v7.js:4048 sets
       `max-height:46vh; overflow-y:auto` INLINE on these elements
       (46vh = 261px @320), which beats a normal stylesheet rule.
       Author !important overrides an inline non-important style, so this
       stays CSS-only (no JS change). Mobile-scoped; desktop 46vh untouched. */
    .afb-policy-scroll,
    .afb-waiver-scroll {
        max-height: none !important;
        overflow-y: visible !important;
    }
}

/* =====================================================================
   T2 iPhone POLISH PASS — STAGING137 ONLY — 2026-06-26
   Token: GM_AUTHORIZE_BOOKING_MODAL_IPHONE_CSS_STAGING_POLISH_REVIEW_2026_06_26
   CSS-ONLY. Builds on the 2026-06-25 hotfix block above. Reversible: delete this block.
   (1) denser policy/waiver type · (2) shorter footer + signature scroll-margin · (4) active step label.
   ===================================================================== */
@media (max-width: 480px) {
    /* (1) denser policy/waiver body text -> more per viewport (base was 15px/1.7) */
    .afb-policy-scroll, .afb-waiver-scroll { font-size: 14px; line-height: 1.5; }
    .afb-policy-scroll p, .afb-policy-scroll li,
    .afb-waiver-scroll p, .afb-waiver-scroll li { font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
    .afb-policy-scroll h3, .afb-waiver-header h3 { font-size: 17px; margin-bottom: 12px; }

    /* (2) shorter action footer -> taller scroll body */
    .afb-modal-footer { padding: 12px 16px; gap: 8px; }
    .afb-modal-footer .afb-btn { padding: 10px 16px; font-size: 14px; }
    /* (2) signature + acceptance scroll clear of the footer */
    .afb-signature-section .afb-input,
    .afb-signature-section,
    .afb-waiver-acceptance { scroll-margin-top: 14px; scroll-margin-bottom: 96px; }

    /* (4) reveal ONLY the active step's label under the waiver icon rail */
    .afb-waiver-steps .afb-waiver-step--active .afb-waiver-step-label {
        display: block;
        font-size: 0.5rem;
        line-height: 1.1;
        text-align: center;
        max-width: 5rem;
        white-space: normal;
    }
}
