/* ============================================================
   Greenwoods Dental – Booking Form 2025
   Modal-based multi-step form stylesheet
   ============================================================ */

/* ── Reset / base ─────────────────────────────────────────── */
#greenwoods-contact-form,
#greenwoods-contact-form * {
    box-sizing: border-box;
}

/* ── Modal overlay ─────────────────────────────────────────── */
.gw-overlay {
    position: fixed;
    inset: 0;
    background: #1d2f1db5;
    display: none;              /* hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 2147483646;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.gw-overlay.active {
    display: flex !important;   /* override any inline style */
    opacity: 1;
}

/* ── Modal card ────────────────────────────────────────────── */
.gw-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    /* max-height: 90vh; */
    overflow-y: visible;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ── Header (image strip) ─────────────────────────────────── */
.gw-modal-header {
    background:
        linear-gradient(42deg, rgba(255,255,255,.62), rgba(114,175,90,.58)),
        url('https://file.greenwoodsdental.com/form-modal-header.jpg') center center/cover no-repeat;
    min-height: 52px;
    border-radius: 20px 20px 0 0;
    position: relative;
    flex-shrink: 0;
}

.gw-close-btn {
    position: absolute;
    top: 11px;
    right: 16px;
    background: rgba(255,255,255,.25);
    border: 1px solid #fff;
    outline: 1px solid #62b143;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .15s;
}
.gw-close-btn:hover { background: rgba(255,255,255,.42); }

/* ── Step bar ──────────────────────────────────────────────── */
.gw-step-bar {
    padding: 16px 20px 24px;
    border-top: 1px solid #eef2ee;
    flex-shrink: 0;
}

.gw-step-dots {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    position: relative;
}
.gw-step-dots::before {
    content: '';
    position: absolute;
    top: 10px;
    left: calc(10px + 6%);
    right: calc(10px + 6%);
    height: 2px;
    background: #d4e8cb;
    z-index: 0;
}

.gw-dot-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.gw-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #d4e8cb;
    background: #fff;
    transition: all .25s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #d4e8cb;
}
.gw-dot.done   { background: #62b143; border-color: #62b143; color: #fff; }
.gw-dot.active { background: #046937; border-color: #046937; color: #fff; box-shadow: 0 0 0 3px rgba(98,177,67,.25); }

.gw-dot-label {
    font-size: 9px;
    color: #9ab99a;
    margin-top: 4px;
    font-weight: 500;
    text-align: center;
    letter-spacing: .01em;
    line-height: 1.1;
    white-space: nowrap;
}
.gw-dot-wrap.active-wrap .gw-dot-label { color: #046937; font-weight: 700; }
.gw-dot-wrap.done-wrap   .gw-dot-label { color: #62b143; }

/* ── Modal body ────────────────────────────────────────────── */
.gw-modal-body {
    padding: 24px 24px 20px;
    flex: 1;
    min-height: 0;
}

/* ── Steps ─────────────────────────────────────────────────── */
.gw-step { display: none; }
.gw-step.active { display: block; }

.gw-step-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a2e1a;
    margin-bottom: 16px;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
}

.gw-sub {
    font-size: 13px;
    color: #6b8c6b;
    margin-bottom: 14px;
}

/* ── Labels & Inputs ───────────────────────────────────────── */
label.gw-field-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #046937;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}

.gw-field-group {
    margin-bottom: 14px;
}

.gw-input,
#greenwoods-contact-form input[type="text"],
#greenwoods-contact-form input[type="tel"],
#greenwoods-contact-form input[type="email"],
#greenwoods-contact-form input[type="date"],
#greenwoods-contact-form select,
#greenwoods-contact-form textarea {
    width: 100%;
    border: 1.5px solid #d4e8cb;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 16px;
    color: #1a2e1a;
    outline: none;
    transition: border .15s, box-shadow .15s;
    background: #fff;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}
.gw-input:focus,
#greenwoods-contact-form input:focus,
#greenwoods-contact-form select:focus,
#greenwoods-contact-form textarea:focus {
    border-color: #62b143;
    box-shadow: 0 0 0 3px rgba(98,177,67,.12);
}

#greenwoods-contact-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Date input fix */
#greenwoods-contact-form input[type="date"] {
    height: 44px;
    line-height: 1.2;
}
#greenwoods-contact-form input[type="date"]::-webkit-date-and-time-value { text-align: left; }

/* ── Option / Location buttons ─────────────────────────────── */
.gw-option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}

.gw-option-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

.gw-loc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 4px;
}

.gw-opt-btn,
.gw-loc-btn {
    border: 1.5px solid #d4e8cb;
    border-radius: 10px;
    padding: 12px 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #4a6e4a;
    cursor: pointer;
    transition: all .15s;
    text-align: left;
    font-family: inherit;
}
.gw-opt-btn { text-align: center; }

.gw-opt-btn:hover,
.gw-loc-btn:hover {
    border-color: #62b143;
    color: #046937;
}
.gw-opt-btn.selected,
.gw-loc-btn.selected {
    border-color: #046937;
    background: #f0f8eb;
    color: #046937;
    font-weight: 600;
}

/* ── Name options (existing patient list) ──────────────────── */
.gw-name-option {
    padding: 12px 14px;
    border: 1.5px solid #d4e8cb;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 15px;
    color: #1a2e1a;
    transition: all .15s;
}
.gw-name-option:hover { background: #f0f8eb; border-color: #62b143; }

/* ── Navigation buttons ────────────────────────────────────── */
.gw-btn-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.gw-btn-prev {
    flex: 0 0 auto;
    background: #fff;
    border: 1.5px solid #d4e8cb;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
    color: #6b8c6b;
    cursor: pointer;
    font-weight: 500;
    transition: all .15s;
    font-family: inherit;
}
.gw-btn-prev:hover { border-color: #62b143; color: #046937; }

.gw-btn-next {
    flex: 1;
    background: #61b147;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
    font-family: inherit;
    display: block;
    width: 100%;
    text-align: center;
}
.gw-btn-next:hover { background: #046937; }
.gw-btn-next:disabled { background: #a8d08d; cursor: not-allowed; }

.gw-btn-outline {
    flex: 1;
    background: transparent;
    border: 2px solid #61b147;
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 13px;
    font-weight: 600;
    color: #046937;
    cursor: pointer;
    transition: background .15s, color .15s;
    font-family: inherit;
    display: block;
    width: 100%;
    text-align: center;
}
.gw-btn-outline:hover { background: #f0f9ec; border-color: #046937; }

/* ── Upload box ────────────────────────────────────────────── */
.gw-upload-box {
    border: 1.5px dashed #d4e8cb;
    border-radius: 10px;
    padding: 14px;
    background: #fbfef9;
}
.gw-upload-help {
    font-size: 12px;
    color: #6b8c6b;
    line-height: 1.5;
    margin-bottom: 10px;
}
.gw-upload-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gw-upload-btn {
    border: 1.5px solid #d4e8cb;
    border-radius: 10px;
    padding: 9px 12px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #4a6e4a;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.gw-upload-btn:hover { border-color: #62b143; color: #046937; background: #f7fdf4; }

/* ── Address autocomplete ──────────────────────────────────── */
.gw-clear-address-btn {
    flex-shrink: 0;
    background: #fff;
    border: 1.5px solid #d4e8cb;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #6b8c6b;
    cursor: pointer;
    font-weight: 500;
    transition: all .15s;
    white-space: nowrap;
    font-family: inherit;
}
.gw-clear-address-btn:hover { border-color: #ee5a52; color: #ee5a52; background: #fff6f5; }

#address-suggestions .gw-addr-item {
    padding: 10px 12px;
    font-size: 14px;
    color: #1a2e1a;
    cursor: pointer;
    border-bottom: 1px solid #eef2ee;
}
#address-suggestions .gw-addr-item:last-child { border-bottom: none; }
#address-suggestions .gw-addr-item:hover { background: #f7fdf4; }

/* ── Checkbox row ──────────────────────────────────────────── */
.gw-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    margin-top: 12px;
}
.gw-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #046937;
    flex-shrink: 0;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
.gw-checkbox-row span {
    font-size: 13px;
    color: #6b8c6b;
    line-height: 1.4;
}

/* ── Thank you pane ────────────────────────────────────────── */
.gw-thankyou {
    text-align: center;
    padding: 10px 0;
}
.gw-check {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f0f8eb;
    border: 3px solid #62b143;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}
.gw-thankyou h2 { margin-bottom: 10px; }
.gw-thankyou p  { font-size: 14px; color: #4a6e4a; }

.gw-skip-note {
    font-size: 12px;
    color: #9ab99a;
    margin-top: 8px;
    text-align: center;
}

/* ── Preloader ─────────────────────────────────────────────── */
.preloader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.82);
    z-index: 2147483647;
}
.corners {
    width: 60px;
    height: 60px;
    position: relative;
    animation: gwSpin 3s infinite linear;
}
.corner { width: 100%; height: 100%; position: absolute; }
.corner::before {
    display: block;
    width: 48%;
    height: 48%;
    border-radius: 0 40% 0 40%;
    background: #62b143;
    content: '';
}
@keyframes gwSpin       { to { transform: rotate(360deg); } }
.corner--1 { animation: gwSpin1 3s infinite cubic-bezier(.785,.135,.15,.86); }
.corner--2 { animation: gwSpin2 3s infinite cubic-bezier(.785,.135,.15,.86); }
.corner--3 { animation: gwSpin3 3s infinite cubic-bezier(.785,.135,.15,.86); }
.corner--4 { animation: gwSpin4 3s infinite cubic-bezier(.785,.135,.15,.86); }
@keyframes gwSpin1 { 0%{transform:rotate(0)} 30%{transform:rotate(0)} 70%{transform:rotate(0)} 100%{transform:rotate(360deg)} }
@keyframes gwSpin2 { 0%{transform:rotate(0)} 30%{transform:rotate(270deg)} 70%{transform:rotate(270deg)} 100%{transform:rotate(360deg)} }
@keyframes gwSpin3 { 0%{transform:rotate(0)} 30%{transform:rotate(180deg)} 70%{transform:rotate(180deg)} 100%{transform:rotate(360deg)} }
@keyframes gwSpin4 { 0%{transform:rotate(0)} 30%{transform:rotate(90deg)}  70%{transform:rotate(90deg)}  100%{transform:rotate(360deg)} }

/* ── Validation ─────────────────────────────────────────────── */
.gw-required-error {
    border-color: #ee5a52 !important;
    box-shadow: 0 0 0 3px rgba(238,90,82,.12) !important;
}
@keyframes gwShake {
    0%,100%{transform:translateX(0)}
    25%{transform:translateX(-5px)}
    75%{transform:translateX(5px)}
}
.gw-shake { animation: gwShake .3s ease; }

/* ── Flatpickr z-index override ─────────────────────────────── */
/* .flatpickr-calendar { z-index: 9999999999 !important; } */

/* ── Contact-us form (unchanged shortcode) ──────────────────── */
#greenwoods-contact-info-form .booking-field {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #d4e8cb;
    border-radius: 10px;
    font-size: 16px;
    color: #1a2e1a;
    outline: none;
    margin-bottom: 12px;
    font-family: inherit;
    transition: border .15s, box-shadow .15s;
}
#greenwoods-contact-info-form .booking-field:focus {
    border-color: #62b143;
    box-shadow: 0 0 0 3px rgba(98,177,67,.12);
}
#greenwoods-contact-info-form .submit-button {
    background: #61b147;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    font-family: inherit;
}
#greenwoods-contact-info-form .submit-button:hover { background: #046937; }

#success-message {
    background: #62b143;
    color: #fff;
    border-radius: 10px;
    padding: 16px;
    font-size: 15px;
    text-align: center;
    margin-bottom: 16px;
    font-weight: 600;
}

/* ── Confirmation form (unchanged) ─────────────────────────── */
.booking-modal-overlay { position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;justify-content:center;align-items:flex-end;z-index:2147483646; }
.booking-modal-overlay.active { display:flex; }
.booking-modal-content { background:#fff;width:100%;height:80%;border-radius:20px 20px 0 0;position:fixed;bottom:0;transform:translateY(100%);transition:transform .3s ease-in-out;overflow-y:auto; }
.booking-modal-overlay.active .booking-modal-content { transform:translateY(0);padding:40px; }
.close-button { position:absolute;top:15px;right:20px;font-size:28px;font-weight:bold;color:#aaa;cursor:pointer;transition:color .3s; }
.close-button:hover { color:#000; }

/* Results table (admin confirmation page) */
#results-container { display:none;margin-top:20px;padding:20px;background:#f9f9f9;border:1px solid #ddd;border-radius:8px; }
.search-results-table { width:100%;border-collapse:collapse;margin-top:20px; }
.search-results-table th,.search-results-table td { padding:12px;text-align:left;border-bottom:1px solid #ddd; }
.search-results-table th { background:#0073aa;color:#fff;font-weight:bold; }
.search-results-table tr:nth-child(even) { background:#f2f2f2; }
.hidden { display:none; }

/* ── Insurance step ─────────────────────────────────────────── */
.gw-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Collapsible accordion */
.gw-ins-collapsible {
    border: 1.5px solid #d4e8cb;
    border-radius: 10px;
    overflow: hidden;
}

.gw-ins-accordion {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f7fdf4;
    border: none;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #046937;
    text-transform: uppercase;
    letter-spacing: .05em;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
    text-align: left;
}
.gw-ins-accordion:hover { background: #edf7e8; }
.gw-ins-accordion--collapsed { color: #6b8c6b; background: #fff; }
.gw-ins-accordion--collapsed:hover { background: #f7fdf4; color: #046937; }

.gw-ins-chevron {
    font-size: 11px;
    flex-shrink: 0;
    margin-left: 8px;
    transition: color .15s;
}

.gw-ins-panel {
    padding: 0 14px 14px;
    padding-top: 10px;
}

/* Searchable insurance dropdown */
.gw-ins-combo-wrap {
    position: relative;
}

.gw-ins-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #d4e8cb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999;
}

.gw-ins-item {
    padding: 10px 14px;
    font-size: 13px;
    color: #1a2e1a;
    cursor: pointer;
    border-bottom: 1px solid #eef2ee;
    transition: background .1s;
}
.gw-ins-item:last-child { border-bottom: none; }
.gw-ins-item:hover { background: #f0f8eb; color: #046937; }

.gw-ins-other-item {
    font-style: italic;
    color: #6b8c6b;
    border-bottom: 2px solid #d4e8cb;
}
.gw-ins-other-item:hover { background: #f7fdf4; color: #046937; }

@media (max-width:420px) {
    .gw-two-col { grid-template-columns: 1fr; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width:420px) {
    .gw-step-dots::before { left:8%; right:8%; }
    .gw-dot-label { font-size: 8px; }
    .gw-modal-body { padding: 16px 14px 14px; }
    .gw-option-grid { grid-template-columns: 1fr; }
}
@media screen and (min-width: 200px) and (max-width: 445px) {
    #gw-ins-choice .gw-option-flex {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
@media (max-width:600px) {
    .booking-modal-content { height:90%; }
}

/* ── Thank you links ─────────────────────────────────────────────── */
a.thanks-links {
    color: #046937;
    text-decoration: none;
}

/* ── Insurance step – choice-view nav additions ─────────────── */

/* #gw-ins-choice needs to stop being a bare gw-option-grid
   (it's now a wrapper div), so re-declare the grid inside it */
#gw-ins-choice .gw-option-grid {
    margin-bottom: 0; /* remove the 4px default; btn-row adds its own top margin */
}

#gw-ins-choice .gw-option-flex {
    margin-bottom: 0; /* remove the 4px default; btn-row adds its own top margin */
}


/* The choice-view Back/Next row sits inside #gw-ins-choice.
   It reuses .gw-btn-row / .gw-btn-prev / .gw-btn-next which are already
   defined — no extra rules needed there. Just remove the extra top margin
   the generic .gw-btn-row adds so spacing stays tight on the choice screen. */
#gw-ins-choice .gw-btn-row {
    margin-top: 12px;
}

/* gw-required-error applied to the collapsible wrap should show a
   coloured border on the accordion header, not the hidden panel.
   The existing rule targets border-color on the element itself —
   since .gw-ins-collapsible already has a border, this overrides it. */
.gw-ins-collapsible.gw-required-error {
    border-color: #ee5a52 !important;
    box-shadow: 0 0 0 3px rgba(238,90,82,.12) !important;
}

/* ── Insurance Navigation ────────────────────────────────────── */
.gw-next-btn {
    flex: 1;
    background: #61b147;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
    font-family: inherit;
    display: block;
    width: 100%;
    text-align: center;
}

.gw-back-btn, .gw-clear-btn {
    flex: 0 0 auto;
    background: #fff;
    border: 1.5px solid #d4e8cb;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
    color: #6b8c6b;
    cursor: pointer;
    font-weight: 500;
    transition: all .15s;
    font-family: inherit;
}

.gw-nav-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}


.gw-ins-primary-wrap, .gw-ins-secondary-wrap {
    border: 1.5px solid #d4e8cb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}


/* ── Labels & Inputs ───────────────────────────────────────── */
label.gw-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #046937;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}

.gw-req{
    color: #c00;    
}

/* ── Tiny screens ───────────────────────────────────────── */
@media screen and (min-width: 200px) and (max-width: 380px) {
    .gw-step-bar, .gw-sub{
        display: none;
    }

    .gw-ins-accordion span{
        font-size:10px;
    }
    .gw-modal-body h3, .gw-modal-body h2{
        font-size: 14px;
    }

    #gw-step-2b h3{
        padding-bottom: 5px;
    }

    .gw-btn-next {
        font-size: 12px !important;
    }

    .gw-ins-accordion{
        padding: 6px 16px;
    }

    .gw-field-group{
        margin-bottom: 5px;
    }
    .gw-input, #greenwoods-contact-form input[type="text"]{
        padding: 6px 8px;
    }
    label.gw-label{
        font-size: 8px;
    }
    .gw-modal-body{
    padding:6px 12px 12px;
    }

    .gw-step-title{
        margin-bottom: 12px;
    }
    .gw-ins-primary-wrap, .gw-ins-secondary-wrap{
        margin-bottom: 7px;
    }
}

/* ── Hide "Later - " text on small screens ──────────────── */
@media screen and (min-width: 446px) and (max-width: 496px) {
    .hider {
        display: none;
    }
}

.ins-card{
    color: #046937;
    background: #deebe5;
    border-radius: 5px;
    padding: 2px 7px;
    font-weight: 500;
}

#ins_upload_clear_btn{
    display: none;
}

@media screen and (min-width: 200px) and (max-width: 445px) {
    #gw-ins-choice .gw-option-flex {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
	  .hider {
        display: unset;
    }
}