/* ==========================================================================
   Dunedin Taxis - Book Online modal
   All classes are prefixed `dt-` so nothing collides with the site's
   Bootstrap 4 or Tailwind utilities, both of which are loaded globally.
   ========================================================================== */

:root {
    --dt-green: #80BD01;
    --dt-green-dark: #6ca001;
    --dt-blue: #00577D;
    --dt-text: #212529;
    --dt-muted: #6d6e6e;
    --dt-border: #d6d9d1;
    --dt-error: #c62828;
    --dt-radius: 6px;
}

/* --- Hero button row ------------------------------------------------------ */

.dt-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

/* The "Book Online" trigger reuses .btn .btn-primary .btn-lg from the site,
   so it is visually identical to the existing phone button. */
.dt-book-trigger {
    cursor: pointer;
}

/* --- Overlay -------------------------------------------------------------- */

.dt-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(0, 0, 0, .6);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dt-modal.is-open {
    display: flex;
}

body.dt-modal-open {
    overflow: hidden;
}

/* --- Dialog --------------------------------------------------------------- */

.dt-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    text-align: left;
    animation: dt-pop .22s ease-out;
}

@keyframes dt-pop {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .dt-modal__dialog { animation: none; }
}

.dt-modal__header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 14px;
    background: #fff;
    border-bottom: 1px solid var(--dt-border);
    border-radius: 10px 10px 0 0;
}

.dt-modal__title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--dt-blue);
}

.dt-modal__close {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    color: var(--dt-muted);
    background: transparent;
    border: 1px solid var(--dt-border);
    border-radius: 50%;
    cursor: pointer;
}

.dt-modal__close:hover,
.dt-modal__close:focus {
    color: #fff;
    background: var(--dt-blue);
    border-color: var(--dt-blue);
}

.dt-modal__body {
    padding: 20px 24px 28px;
}

.dt-intro {
    margin: 0 0 20px;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--dt-muted);
}

.dt-required-note {
    margin: 0 0 18px;
    font-size: .85rem;
    color: var(--dt-muted);
}

/* --- Layout --------------------------------------------------------------- */

.dt-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
}

.dt-col {
    flex: 1 1 100%;
    min-width: 0;
}

@media (min-width: 600px) {
    .dt-col--half  { flex: 1 1 calc(50% - 9px); }
    .dt-col--third { flex: 1 1 calc(33.333% - 12px); }
}

.dt-fieldset {
    margin: 0 0 8px;
    padding: 0;
    border: 0;
}

.dt-fieldset__legend {
    width: 100%;
    margin: 18px 0 10px;
    padding: 0 0 6px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--dt-blue);
    border-bottom: 1px solid var(--dt-border);
}

/* --- Fields --------------------------------------------------------------- */

.dt-field {
    margin-bottom: 16px;
}

.dt-label {
    display: block;
    margin-bottom: 5px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--dt-text);
}

.dt-label .dt-req {
    color: var(--dt-error);
}

.dt-hint {
    display: block;
    margin-top: 4px;
    font-size: .75rem;
    color: var(--dt-muted);
}

.dt-input,
.dt-select,
.dt-textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 16px; /* 16px stops iOS Safari zooming on focus */
    line-height: 1.4;
    color: var(--dt-text);
    background-color: #fff;
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius);
    -webkit-appearance: none;
    appearance: none;
}

.dt-select {
    padding-right: 34px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%236d6e6e' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}

.dt-textarea {
    min-height: 84px;
    resize: vertical;
}

.dt-input:focus,
.dt-select:focus,
.dt-textarea:focus {
    outline: 0;
    border-color: var(--dt-green);
    box-shadow: 0 0 0 3px rgba(128, 189, 1, .22);
}

/* Error state */
.dt-field.-error .dt-input,
.dt-field.-error .dt-select,
.dt-field.-error .dt-textarea {
    border-color: var(--dt-error);
}

.dt-field.-error .dt-input:focus,
.dt-field.-error .dt-select:focus,
.dt-field.-error .dt-textarea:focus {
    box-shadow: 0 0 0 3px rgba(198, 40, 40, .18);
}

.dt-error-text {
    display: none;
    margin-top: 5px;
    font-size: .78rem;
    color: var(--dt-error);
}

.dt-field.-error .dt-error-text {
    display: block;
}

/* Time row: HH / MM / AM-PM sit side by side on every screen size */
.dt-time {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dt-time .dt-select {
    flex: 1 1 0;
}

/* Honeypot - hidden from people, visible to naive bots */
.dt-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --- Conditional flight section ------------------------------------------ */

.dt-flight {
    display: none;
}

.dt-flight.is-visible {
    display: flex; /* it is also a .dt-row */
}

/* --- reCAPTCHA v3 ---------------------------------------------------------- */

/* v3 has no checkbox. Google's floating badge is hidden, which its terms
   allow only while the notice below stays visible in the form. */
.grecaptcha-badge {
    visibility: hidden;
}

.dt-recaptcha-note {
    margin: 22px 0 6px;
    font-size: .8rem;
    line-height: 1.5;
    color: #666;
}

.dt-recaptcha-note a {
    color: inherit;
    text-decoration: underline;
}

/* --- Footer / submit ------------------------------------------------------ */

.dt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 18px;
}

.dt-submit {
    padding: 12px 34px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--dt-green);
    border: 1px solid var(--dt-green);
    border-radius: 33px;
    box-shadow: 5px 3px 6px #00000029;
    cursor: pointer;
}

.dt-submit:hover:not(:disabled) {
    background-color: var(--dt-green-dark);
    border-color: var(--dt-green-dark);
}

.dt-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.dt-form-error {
    display: none;
    width: 100%;
    margin-top: 14px;
    padding: 12px 14px;
    font-size: .875rem;
    color: #7f1d1d;
    background: #fdecea;
    border: 1px solid #f5c6c2;
    border-radius: var(--dt-radius);
}

.dt-form-error.is-visible {
    display: block;
}

/* --- Success panel -------------------------------------------------------- */

.dt-success {
    display: none;
    padding: 28px 8px;
    text-align: center;
}

.dt-success.is-visible {
    display: block;
}

.dt-success__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    margin: 0 auto 16px;
    font-size: 34px;
    color: #fff;
    background: var(--dt-green);
    border-radius: 50%;
}

.dt-success__title {
    margin: 0 0 10px;
    font-size: 1.4rem;
    color: var(--dt-blue);
}

.dt-success__text {
    max-width: 44ch;
    margin: 0 auto 22px;
    line-height: 1.6;
    color: var(--dt-muted);
}

/* When the form has been sent, hide the form itself */
.dt-modal.is-sent .dt-modal__form {
    display: none;
}

/* --- Small screens -------------------------------------------------------- */

@media (max-width: 575px) {
    .dt-modal {
        padding: 0;
    }

    .dt-modal__dialog {
        min-height: 100%;
        border-radius: 0;
    }

    .dt-modal__header {
        padding: 16px 18px 12px;
        border-radius: 0;
    }

    .dt-modal__title {
        font-size: 1.25rem;
    }

    .dt-modal__body {
        padding: 16px 18px 32px;
    }

    .dt-submit {
        width: 100%;
    }
}

/* The "Last" name label is only a spacer to line up with "Passenger Name"
   when the two inputs sit side by side. Once they stack it just adds a gap. */
@media (max-width: 599px) {
    .dt-label--spacer {
        display: none;
    }
}

/* Screen-reader-only text inside the popup. Scoped so it never depends on,
   or changes, the site's own .sr-only rule. */
.dt-modal .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
