/* ===== Variabile CSS pentru consistență ===== */
:root {
    --hp-primary: #0058a2;
    --hp-primary-contrast: #fff;
    --hp-muted: #e3e8ef;
    --hp-done: #2e7d32;
    --hp-text: #111827;
    --hp-subtext: #6b7280;
    --hp-radius: 10px;
    --hpw-locate-h: 40px;
    --hpw-progress-h: 16px;
}

/* util: screen-reader only */
.hpw-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

/* ===== Container principal (wizard) ===== */
#hpw-request {
    background: #fff;
    padding: 24px;
    border-radius: var(--hp-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .06)
}

#hpw-request .hpw-progress-wrap {
    margin-bottom: 18px
}

#hpw-request .hpw-step-heading {
    font-weight: 800;
    color: #0f172a;
    font-size: 20px;
    margin-bottom: 10px
}

/* Bară de progres */
#hpw-request .hpw-progress {
    width: 100%;
    height: var(--hpw-progress-h);
    border-radius: 999px;
    background: var(--hp-muted) !important;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .06);
    margin-bottom: 24px
}

#hpw-request .hpw-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--hp-primary) !important;
    position: relative;
    transition: width .35s ease;
    display: flex;
    align-items: center;
    justify-content: center
}

#hpw-request .hpw-progress-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    line-height: 1;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25)
}

#hpw-request .hp-steps,
#hpw-request .hp-current-step-title {
    display: none !important
}

/* ===== Layout pași ===== */
#hpw-request .hp-step {
    position: relative;
    padding-bottom: 72px;
    margin: 0;
    border: 0
}

#hpw-request .hp-step[hidden] {
    display: none !important
}

#hpw-request label {
    display: block;
    font-weight: 600;
    margin: .8rem 0 .35rem;
    color: var(--hp-text)
}

#hpw-request .hp-row {
    display: grid;
    gap: 16px
}

#hpw-request .hp-row-2 {
    grid-template-columns: 1fr 1fr
}

#hpw-request .hp-field {
    display: flex;
    flex-direction: column
}

#hpw-request .hpw-auto-title-note {
    font-size: 13px;
    color: var(--hp-subtext);
    margin-bottom: 4px
}

#hpw-request .hpw-help {
    font-size: 13px;
    color: var(--hp-subtext);
    margin-top: 6px
}

/* ===== Inputs ===== */
#hpw-request select,
#hpw-request input[type="text"],
#hpw-request input[type="email"],
#hpw-request input[type="tel"],
#hpw-request input[type="date"],
#hpw-request input[type="number"],
#hpw-request input[type="file"],
#hpw-request textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 16px;
    box-sizing: border-box;
    background: #fff;
    transition: border-color .2s
}

#hpw-request select:focus,
#hpw-request input:focus,
#hpw-request textarea:focus {
    outline: none;
    border-color: var(--hp-primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, .1)
}

/* ===== Locație + buton GPS (wizard - fallback) ===== */
#hpw-request .hpw-location-wrap {
    position: relative
}

#hpw-request .hpw-location-wrap>input {
    padding-right: 48px
}

#hpw-request .hpw-locate {
    position: absolute;
    right: 8px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    width: var(--hpw-locate-h);
    height: var(--hpw-locate-h);
    min-width: 36px;
    min-height: 36px;
    max-width: 44px;
    max-height: 44px;
    border-radius: 4px;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none
}

#hpw-request .hpw-locate .hp-icon {
    font-size: 16px;
    line-height: 1;
    color: #374151;
    opacity: .85
}

#hpw-request .hpw-locate:hover .hp-icon {
    color: #111827;
    opacity: 1
}

#hpw-request .hpw-locate:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, .2)
}

/* ===== Repară butonul "Locate Me" pentru câmpul oficial HivePress în Wizard ===== */
#hpw-request .hp-field--location {
    display: flex;
    position: relative;
    align-items: center;
}

#hpw-request .hp-field--location input[type="text"] {
    width: 100%;
    padding-right: 40px;
    /* Face loc pentru buton */
    box-sizing: border-box;
}

#hpw-request .hp-field--location a {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    text-decoration: none;
    z-index: 2;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

#hpw-request .hp-field--location a:hover {
    color: #333;
}

/* ===== Subcategorii ===== */
#hpw-request .hpw-list-item {
    display: block;
    margin: .25rem 0;
    font-weight: 500
}

#hpw-request .hpw-list-item input[type="radio"] {
    width: auto;
    margin-right: 8px
}

/* ===== Contact ===== */
#hpw-request .hpw-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

#hpw-request .hpw-consent {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    color: #0f172a
}

#hpw-request .hpw-consent input {
    margin-right: 8px
}

/* ===== intl-tel-input ===== */
#hpw-request .iti {
    width: 100%
}

#hpw-request .iti__flag-container {
    z-index: 2
}

#hpw-request .iti--allow-dropdown input[type="tel"],
#hpw-request .iti--allow-dropdown input[type="text"] {
    padding-left: 88px !important
}

#hpw-request .iti__selected-flag {
    padding: 0 6px 0 10px
}

/* ===== Butoane navigare ===== */
#hpw-request .hp-step:not([hidden]) .hp-prev {
    position: absolute;
    left: 0;
    bottom: 0;
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #e5e7eb;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600
}

#hpw-request .hp-step:not([hidden]) .hp-next,
#hpw-request .hp-step:not([hidden]) .hpw-submit-btn {
    position: absolute;
    right: 0;
    bottom: 0;
    background: var(--hp-primary);
    color: var(--hp-primary-contrast);
    border: 0;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600
}

#hpw-request .hp-prev:hover {
    background: #e9ecef
}

#hpw-request .hp-next:hover,
#hpw-request .hpw-submit-btn:hover {
    filter: brightness(.95)
}

#hpw-request .hpw-submit-btn {
    box-shadow: none !important
}

/* ===== Validare ===== */
#hpw-request .hpw-not-valid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12) !important
}

#hpw-request .hpw-error-msg {
    color: #dc2626;
    font-size: 12px;
    margin-top: 6px
}

/* ===== Modal geo (folosit și în QS) ===== */
.hpw-geo-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999
}

.hpw-geo-modal.is-open {
    display: block
}

.hpw-geo-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    backdrop-filter: blur(2px)
}

.hpw-geo-modal__dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 4px;
    padding: 18px 20px;
    width: min(92vw, 420px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2)
}

.hpw-geo-modal__dialog h3 {
    margin: 0 0 8px;
    font-size: 18px
}

.hpw-geo-modal__dialog p {
    margin: 0 0 12px;
    color: #374151;
    line-height: 1.35
}

.hpw-geo-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 6px;
    margin-bottom: 12px
}

.hpw-geo-modal__actions button {
    border: 0;
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600
}

.hpw-geo-cancel {
    background: #f3f4f6;
    color: #111827
}

.hpw-geo-allow {
    background: var(--hp-primary);
    color: #fff
}

/* ===== Overlay submit ===== */
#hpw-request .hpw-submit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999
}

#hpw-request .hpw-submit-overlay[hidden] {
    display: none !important
}

#hpw-request .hpw-overlay__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center
}

#hpw-request .hpw-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(0, 0, 0, .1);
    border-top-color: var(--hp-primary);
    animation: hpwspin 1s linear infinite;
    margin-bottom: 16px
}

#hpw-request .hpw-overlay__msg {
    font-weight: 600;
    color: #0f172a;
    font-size: 16px
}

@keyframes hpwspin {
    to {
        transform: rotate(360deg)
    }
}

/* ===== QUICK SEARCH (bară orizontală, 2 câmpuri + geo identic cu wizard) ===== */
#hpw-quicksearch.hpw-qs {
    background: #fff;
    padding: 16px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
    margin-top: -5.75rem
}

.hpw-qs .hpw-qs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: center
}

.hpw-qs .hpw-qs-field select,
.hpw-qs .hpw-qs-field input[type="text"] {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 1.125rem;
    background: #fff;
    transition: border-color .2s
}

.hpw-qs .hpw-qs-field select:focus,
.hpw-qs .hpw-qs-field input[type="text"]:focus {
    outline: none;
    border-color: var(--hp-primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, .1)
}

/* Locație cu icon în interior – identic cu wizard */
.hpw-qs .hpwqs-location-wrap {
    position: relative
}

.hpw-qs .hpwqs-location-wrap>input {
    padding-right: 48px
}

.hpw-qs .hpwqs-locate {
    position: absolute;
    right: 8px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    width: var(--hpw-locate-h);
    height: var(--hpw-locate-h);
    min-width: 36px;
    min-height: 36px;
    max-width: 44px;
    max-height: 44px;
    border-radius: 4px;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center
}

.hpw-qs .hpwqs-locate .hp-icon {
    font-size: 16px;
    line-height: 1;
    color: #374151;
    opacity: .85
}

.hpw-qs .hpwqs-locate:hover .hp-icon {
    color: #111827;
    opacity: 1
}

.hpw-qs .hpwqs-locate:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, .2)
}

/* Buton Caută – aliniat perfect cu inputurile */
.hpw-qs .hpw-qs-action {
    display: flex;
    align-items: center
}

.hpw-qs .hpw-qs-submit {
    height: 48px;
    line-height: 48px;
    padding: 0 18px;
    background: var(--hp-primary);
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-size: 1.125rem;
    font-weight: 300;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.hpw-qs .hpw-qs-submit:hover {
    filter: brightness(.95)
}

/* Select cu "săgeată" aliniată ca butonul de geo */
.hpw-qs .hpw-qs-field--select {
    position: relative;
}

.hpw-qs .hpw-qs-field--select select {
    -webkit-appearance: none;
    appearance: none;
    background-image: none;
    padding-right: calc(var(--hpw-locate-h) + 8px);
}

.hpw-qs .hpw-qs-field--select::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    width: var(--hpw-locate-h);
    height: var(--hpw-locate-h);
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* ===== Stilizare Telefon și Locație pe Card (integrat) ===== */
.hp-listing--view-block .hp-listing__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.hp-listing__attribute--hpw-phone .hp-tool-button {
    font-size: 1.1em;
    color: #6B7280;
    text-decoration: none;
    display: inline-block;
}

.hp-listing__attribute--hpw-phone .hp-tool-button:hover {
    color: #0058a2;
}

/* ===== Responsive ===== */
@media (max-width:768px) {
    #hpw-request {
        padding: 16px
    }

    /* Regula generală - păstrată */
    #hpw-request select,
    #hpw-request input[type="text"],
    #hpw-request input[type="email"],
    #hpw-request input[type="tel"],
    #hpw-request input[type="date"],
    #hpw-request input[type="number"] {
        height: 40px;
        padding: 0 12px;
    }

    /* [FIX] Forțăm înălțimea și padding-ul pentru Locație pe mobil */
    #hpw-request .hp-field--location input[type="text"],
    #hpw-request .hpw-location-wrap input[type="text"] {
        padding-right: 40px !important;
        /* Spațiu vital pentru iconiță */
        padding-left: 12px !important;
        height: 40px !important;
        /* Asigură înălțimea */
        min-height: 40px !important;
        line-height: 1.5 !important;
    }

    #hpw-request .hpw-contact-grid {
        grid-template-columns: 1fr
    }

    #hpw-request .hp-step {
        padding-bottom: 72px
    }

    #hpw-request .hp-step:not([hidden]) .hp-prev,
    #hpw-request .hp-step:not([hidden]) .hp-next,
    #hpw-request .hp-step:not([hidden]) .hpw-submit-btn {
        position: static;
        display: inline-flex;
        margin-top: 16px
    }

    #hpw-request .hp-buttons {
        display: flex !important;
        gap: 12px;
        justify-content: space-between;
        margin-top: 24px
    }

    #hpw-request .hpw-spinner {
        width: 36px;
        height: 36px;
        margin-bottom: 12px
    }

    #hpw-request .hpw-overlay__msg {
        font-size: 14px
    }

    .hpw-qs .hpw-qs-grid {
        grid-template-columns: 1fr;
        gap: 12px
    }

    .hpw-qs .hpw-qs-submit {
        width: 100%
    }

    /* Mută Locația pe card - Doar pe mobil */
    .hp-listing--view-block {
        position: relative;
        padding-bottom: 50px !important;
    }

    .hp-listing--view-block .hp-request__location {
        position: absolute;
        bottom: 16px;
        right: 16px;
        margin: 0;
        z-index: 2;
        font-size: 0.9em;
    }
}

/* Offers Counter (Request Card) */
.hp-request-offers-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.hp-request__offers-count {
    font-weight: bold !important;
    margin-left: auto !important;
    color: var(--hp-primary) !important;
}