:root {
    --black: #000000;
    --gray-900: #111827;
    --gray-400: #6b7280;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --white: #ffffff;
    --error: #dc2626;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-size: 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--white);
    color: var(--black);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 540px;
    padding: 2.5rem;
    margin: 2rem auto;
}

/* Typography & Headers */
h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--gray-400);
    margin-bottom: 1.5rem;
}

.step-desc {
    font-size: 0.9rem;
    color: var(--gray-400);
    margin-bottom: 2rem;
}

.help-text {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-bottom: 0.75rem;
    display: block;
}

.header-divider {
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--gray-100);
    margin-bottom: 0.5rem;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--black);
    transition: width 0.4s ease;
}

.step-indicator {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--black);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Carousel Layout */
.carousel-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    /* Remove fixed height, but hide overflow X */
}

.carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    align-items: flex-start;
}

.carousel-step {
    min-width: 100%;
    flex: 0 0 100%;
    padding-right: 2px;
    /* Prevent text clipping on right edge */
    transition: opacity 0.3s;
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

.carousel-step.active {
    opacity: 1;
    pointer-events: auto;
    height: auto;
    overflow: visible;
}

/* Basic Form Elements */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

label:not(.radio-label):not(.checkbox-label) {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

/* Style the new v3 Google Places Web Component to match native inputs */
gmp-place-autocomplete {
    width: 100%;
}

gmp-place-autocomplete::part(input) {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

input[type="date"],
input[type="time"] {
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 0;
    font-family: inherit;
    font-size: 1rem;
    color: var(--black);
    background-color: var(--white);
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    max-width: 100%;
}

input:focus {
    border-color: var(--black);
}

input:invalid:not(:placeholder-shown) {
    border-color: var(--error);
}

/* Custom Radios and Checkboxes */
.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.radio-group.vertical {
    flex-direction: column;
    gap: 1rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
}

.radio-label input,
.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-radio,
.custom-checkbox {
    min-width: 20px;
    width: 20px;
    height: 20px;
    border: 1px solid var(--gray-400);
    margin-right: 0.75rem;
    display: inline-block;
    position: relative;
    background: var(--white);
    margin-top: 2px;
}

.custom-radio {
    border-radius: 50%;
}

.radio-label input:checked~.custom-radio {
    border-color: var(--black);
    border-width: 6px;
}

.checkbox-label input:checked~.custom-checkbox {
    background-color: var(--black);
    border-color: var(--black);
}

.checkbox-label input:checked~.custom-checkbox:after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 10px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.checkbox-text strong {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.checkbox-text span {
    font-size: 0.85rem;
    color: var(--gray-400);
    line-height: 1.4;
}

.highlight-box {
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
}

.agreement-box {
    padding: 1.5rem;
    border: 1px dashed var(--gray-400);
}

.signature-box {
    padding: 1.5rem;
    border: 1px solid var(--black);
    background: var(--gray-100);
}

/* Quantities (Step 1) */
.equipment-selection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.item-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--gray-200);
}

.item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    margin-right: 1rem;
    color: var(--black);
}

.item-details {
    flex-grow: 1;
}

.item-details h4 {
    border-bottom: none;
    margin: 0;
    padding: 0;
    font-size: 1.1rem;
}

.rate {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-200);
}

.qty-btn {
    background: var(--white);
    border: none;
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background 0.1s;
}

.qty-btn:hover {
    background: var(--gray-100);
}

.qty-btn.minus {
    border-right: 1px solid var(--gray-200);
}

.qty-btn.plus {
    border-left: 1px solid var(--gray-200);
}

.qty-input {
    width: 48px;
    height: 40px;
    text-align: center;
    border: none;
    font-weight: 600;
    padding: 0;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Quotes and Costs */
.quote-preview {
    padding: 1rem;
    background: var(--gray-100);
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
}

.final-quote-box {
    border: 2px solid var(--black);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.quote-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.quote-row.total {
    border-top: 1px solid var(--gray-200);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.deposit-notice {
    margin-top: 1rem;
    background: var(--gray-100);
    padding: 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
    border-left: 4px solid var(--black);
}

.deposit-notice strong {
    display: block;
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* Payment & Waiver Section */
.payment-methods {
    margin-bottom: 2rem;
}

.payment-grid {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.qr-container {
    flex: 0 0 120px;
    max-width: 120px;
}

.qr-container img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--gray-200);
}

.payment-text p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.payment-text a {
    color: var(--black);
    font-weight: 600;
    text-decoration: underline;
}

.waiver-section {
    margin-bottom: 2rem;
}

.waiver-scroll {
    height: 250px;
    overflow-y: scroll;
    border: 1px solid var(--gray-200);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--gray-100);
}

.waiver-scroll img {
    width: 100%;
    height: auto;
    display: block;
}

/* Using image as requested */

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.primary-btn,
.secondary-btn {
    padding: 1.25rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s, transform 0.1s;
    text-align: center;
    width: 100%;
}

.primary-btn {
    background-color: var(--black);
    color: var(--white);
}

.primary-btn:hover {
    opacity: 0.9;
}

.primary-btn:active {
    transform: scale(0.98);
}

.secondary-btn {
    background-color: var(--white);
    color: var(--black);
    border: 1px solid var(--black);
}

.secondary-btn:hover {
    background-color: var(--gray-100);
}

.loader {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-400);
    margin: 2rem 0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.hidden {
    display: none !important;
}

.status-msg {
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid;
}

.status-error {
    border-color: var(--error);
    color: var(--error);
    background: #fef2f2;
}

/* Success Panel */
.success-layout {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border: 2px solid var(--black);
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.success-desc {
    margin-bottom: 2rem;
    color: var(--gray-400);
}

.receipt-details {
    margin: 2rem 0;
    padding: 1.5rem;
    border: 1px dashed var(--gray-400);
    text-align: left;
    background: var(--gray-100);
}

.receipt-details p {
    display: flex;
    justify-content: space-between;
    margin: 0.5rem 0;
    color: var(--gray-900);
}

/* Image Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border: 2px solid var(--white);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

@media (max-width: 600px) {
    body {
        align-items: flex-start;
    }

    .container {
        padding: 1.25rem 1rem 5rem 1rem;
        margin: 0;
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
    }

    h2 {
        font-size: 1.35rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    h4 {
        font-size: 1.05rem;
    }

    .subtitle {
        margin-bottom: 1rem;
        font-size: 0.95rem;
    }

    .step-desc {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .help-text {
        font-size: 0.85rem;
    }

    label:not(.radio-label):not(.checkbox-label) {
        font-size: 0.9rem;
        /* Bumped up from 0.85rem */
    }

    .header-divider {
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }

    /* Enhance Touch Targets & Prevent iOS Zoom */
    input[type="date"],
    input[type="text"],
    input[type="tel"],
    input[type="time"],
    .radio-label,
    .checkbox-label {
        font-size: 16px;
    }

    .btn-group {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .payment-grid {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Reorganize Item Cards for tiny screens */
    .item-card {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .item-icon {
        margin-right: 0.5rem;
        width: 40px;
        height: 40px;
    }

    .item-details {
        flex-grow: 1;
        min-width: 50%;
    }

    .quantity-control {
        width: 100%;
        margin-top: 0.5rem;
        justify-content: space-between;
    }

    .qty-btn {
        width: 45px;
        height: 45px;
    }

    .qty-input {
        flex-grow: 1;
        height: 45px;
    }

    /* Compress Boxes */
    .highlight-box,
    .agreement-box,
    .signature-box,
    .final-quote-box {
        padding: 1rem;
    }

    .waiver-scroll {
        height: 180px;
    }
}