:root {
    --ink: #18221f;
    --muted: #68716d;
    --line: rgba(24, 34, 31, 0.12);
    --cream: #fbf7ef;
    --paper: #ffffff;
    --teal: #0f6b61;
    --teal-dark: #083f3a;
    --sun: #e8b44f;
    --terracotta: #c36b2c;
    --sea: #d8f0ed;
    --shadow: 0 24px 80px rgba(10, 30, 27, 0.22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--cream);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-shell {
    min-height: 100vh;
}

.hero {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 28px clamp(16px, 4vw, 48px) 42px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(90deg, rgba(9, 42, 39, 0.92), rgba(9, 42, 39, 0.62) 43%, rgba(251, 247, 239, 0.24)),
        url("../img/puglia-hero.png") center / cover;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 34%;
    z-index: -1;
    background: linear-gradient(0deg, var(--cream), rgba(251, 247, 239, 0));
}

.topbar {
    width: min(1180px, 100%);
    margin: 0 auto 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 40;
}

.brand,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    color: #fff;
    font-weight: 800;
    font-size: clamp(18px, 2vw, 22px);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    color: var(--sun);
}

.language-select,
.admin-link {
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 8px;
    color: #fff;
    background: rgba(7, 33, 30, 0.56);
    backdrop-filter: blur(14px);
}

.language-select {
    max-width: 150px;
    padding: 0 12px;
    appearance: none;
    -webkit-appearance: none;
    background-image: none;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    font-weight: 700;
}

.account-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    isolation: isolate;
}

.account-button {
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}

.account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    display: grid;
    gap: 4px;
    width: max-content;
    min-width: 196px;
    max-width: min(260px, calc(100vw - 24px));
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background: rgba(7, 33, 30, 0.98);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 100;
}

.account-dropdown[hidden] {
    display: none !important;
}

.account-dropdown.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.account-dropdown a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 7px;
    color: #fff;
    font-weight: 800;
    white-space: nowrap;
}

.account-dropdown a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.hero-grid {
    width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(360px, 480px);
    align-items: center;
    gap: clamp(30px, 6vw, 80px);
}

.hero-copy {
    color: #fff;
    padding-bottom: 72px;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    color: var(--sun);
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.hero-copy h1 {
    max-width: 760px;
    margin: 18px 0 20px;
    font-size: clamp(42px, 8vw, 86px);
    line-height: 0.95;
    letter-spacing: 0;
}

.hero-copy p {
    max-width: 600px;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(17px, 2.2vw, 22px);
    line-height: 1.55;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 680px;
    margin-top: 34px;
}

.hero-stats div {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(7, 33, 30, 0.4);
    backdrop-filter: blur(14px);
}

.hero-stats strong,
.hero-stats span {
    display: block;
}

.hero-stats strong {
    color: var(--sun);
    font-size: 24px;
}

.hero-stats span {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.35;
}

.phone-frame {
    width: min(100%, 440px);
    margin-left: auto;
    padding: 12px;
    border-radius: 34px;
    background: linear-gradient(145deg, #18221f, #31413c);
    box-shadow: var(--shadow);
}

.phone-status {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 800;
}

.booking-panel {
    position: relative;
    padding: 18px;
    border-radius: 24px;
    background: var(--paper);
}

.form-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.form-heading h2 {
    margin: 5px 0 0;
    font-size: clamp(22px, 6vw, 30px);
    line-height: 1.05;
    letter-spacing: 0;
}

.stepper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 16px;
}

.step-dot {
    min-width: 0;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #fbfcfb;
    font-size: 12px;
    font-weight: 900;
}

.step-dot.active {
    border-color: rgba(15, 107, 97, 0.28);
    color: var(--teal-dark);
    background: var(--sea);
}

.booking-step {
    display: none;
}

.booking-step.active {
    display: block;
}

.hidden {
    display: none !important;
}

.booking-step h3 {
    margin: 0 0 14px;
    font-size: 22px;
    line-height: 1.15;
}

.route-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: #edf1ef;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.route-badge.ready {
    background: var(--sea);
    color: var(--teal-dark);
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.field-grid.three {
    grid-template-columns: 1.2fr 0.78fr 1.4fr;
}

.field {
    position: relative;
    display: grid;
    gap: 7px;
    margin-bottom: 10px;
}

.field span,
.field-top span,
.price-panel span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.field-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.field-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.text-button {
    border: 0;
    padding: 0;
    color: var(--teal);
    background: transparent;
    font-size: 12px;
    font-weight: 900;
}

.icon-button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(15, 107, 97, 0.18);
    border-radius: 8px;
    padding: 0 9px;
    color: var(--teal-dark);
    background: var(--sea);
    font-size: 12px;
    font-weight: 900;
}

.icon-button span {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 50%;
    position: relative;
}

.icon-button span::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

.icon-button b {
    font: inherit;
}

.field input,
.field select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--ink);
    background: #fbfcfb;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input:focus,
.field select:focus {
    border-color: rgba(15, 107, 97, 0.6);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 107, 97, 0.11);
}

.location-field {
    z-index: 60;
}

.search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    display: none;
    max-height: 210px;
    overflow: auto;
    z-index: 900;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(24, 34, 31, 0.18);
}

.search-results.open {
    display: block;
}

.result-item,
.result-empty {
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(24, 34, 31, 0.08);
    padding: 14px 12px;
    color: var(--ink);
    background: #fff;
    text-align: left;
    font-size: 13px;
    line-height: 1.35;
}

.result-item:hover,
.result-item:focus {
    color: var(--teal-dark);
    background: var(--sea);
    outline: none;
}

.result-empty {
    color: var(--muted);
}

.map {
    height: 210px;
    margin: 2px 0 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--sea);
}

.stage-card {
    display: grid;
    gap: 6px;
    margin: 4px 0 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.stage-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.stage-card strong {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.35;
}

.leaflet-container {
    font: inherit;
}

.price-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 6px 0 12px;
}

.price-panel div {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.price-panel strong {
    display: block;
    margin-top: 5px;
    color: var(--ink);
    font-size: 20px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.primary-button {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(15, 107, 97, 0.25);
}

.step-actions {
    display: grid;
    grid-template-columns: 0.7fr 1fr;
    gap: 10px;
}

.secondary-flow-button {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    font-weight: 900;
}

.summary-list {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.option-grid {
    display: grid;
    gap: 8px;
    margin: 4px 0 14px;
}

.rider-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.choice-card {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: #fbfcfb;
    font-size: 13px;
    font-weight: 900;
}

.choice-card input,
.check-row input {
    accent-color: var(--teal);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
}

.check-row input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.summary-row {
    display: grid;
    grid-template-columns: 0.82fr 1.2fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(24, 34, 31, 0.08);
}

.summary-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.summary-row strong {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.primary-button:disabled,
.text-button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.form-message {
    min-height: 21px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.form-message.success {
    color: var(--teal);
}

.form-message.error {
    color: #b13d2f;
}

.form-message.muted {
    color: var(--muted);
}

.map-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(7, 33, 30, 0.58);
    backdrop-filter: blur(12px);
}

.map-modal.open {
    display: flex;
}

.map-dialog {
    width: min(840px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}

.map-dialog-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.map-dialog-head h2 {
    margin: 4px 0 0;
    font-size: 24px;
    line-height: 1.1;
}

.close-button {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--ink);
    background: #fff;
    font-weight: 900;
}

.map-dialog .map {
    height: min(560px, 62vh);
    margin: 0;
}

.map-hint {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 980px) {
    .hero {
        padding-top: 20px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        padding-bottom: 0;
    }

    .phone-frame {
        margin: 0 auto;
    }
}

@media (max-width: 620px) {
    .hero {
        padding: 14px 12px 26px;
    }

    .topbar {
        align-items: flex-start;
        margin-bottom: 28px;
    }

    .brand span:last-child {
        display: none;
    }

    .topbar-actions {
        gap: 8px;
    }

    .language-select {
        max-width: 124px;
        padding: 0 8px;
    }

    .admin-link {
        padding: 0 11px;
    }

    .hero-copy h1 {
        font-size: clamp(38px, 13vw, 56px);
    }

    .hero-copy p {
        font-size: 16px;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .phone-frame {
        padding: 8px;
        border-radius: 28px;
    }

    .booking-panel {
        padding: 14px;
        border-radius: 22px;
    }

    .field-grid,
    .field-grid.three,
    .price-panel,
    .step-actions {
        grid-template-columns: 1fr;
    }

    .field-grid.three {
        gap: 0;
    }

    .map {
        height: 230px;
    }

    .map-dialog {
        padding: 12px;
        border-radius: 12px;
    }

    .field-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .field-actions {
        width: 100%;
        justify-content: space-between;
    }
}
