/* ===== OVERLAY ===== */
.lead-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10500;
    background: rgba(13, 27, 46, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: leadModalFadeIn 0.22s ease;
}

.lead-modal-overlay[hidden] {
    display: none;
}

@keyframes leadModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lead-modal-wrapper {
    width: 100%;
    max-width: 380px;
    animation: leadModalSlideIn 0.26s cubic-bezier(0.34, 1.36, 0.64, 1);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: visible;
}

@keyframes leadModalSlideIn {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ===== CLOSE BUTTON (modal keeps overlay/Esc close behavior) ===== */
.lead-modal-close {
    display: none;
}

/* ===== FOOTER (override to center within modal) ===== */
.lead-modal-footer {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important;
}

/* ===== FORM STYLES (mirrored from anuncio.css) ===== */
.lead-form {
    position: relative;
    z-index: 10;
    border-radius: 1rem;
    background: linear-gradient(100deg, #0879dc 0%, #38BDF8 100%);
    font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: hidden;
}

.lead-form * {
    font-family: inherit;
}

.lead-card {
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    width: 100%;
    max-width: 380px;
}

.lead-close-confirm[hidden] {
    display: none;
}

.lead-close-confirm {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 26px 24px;
    text-align: center;
    font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.lead-close-confirm * {
    font-family: inherit;
}

.lead-close-confirm__eyebrow {
    margin: 0 0 8px;
    color: #0F7ADE;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lead-close-confirm__title {
    margin: 0;
    color: #0D1B2E;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.16;
}

.lead-close-confirm__text {
    margin: 12px 0 20px;
    color: #64748B;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.55;
}

.lead-close-confirm__primary,
.lead-close-confirm__secondary {
    width: 100%;
    border: 0;
    font-weight: 800;
    cursor: pointer;
}

.lead-close-confirm__primary {
    border-radius: 999px;
    background: #0F7ADE;
    padding: 13px 18px;
    color: #ffffff;
    font-size: 14px;
    box-shadow: 0 12px 22px rgba(15, 122, 222, 0.22);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.lead-close-confirm__primary:hover {
    background: #2563EB;
    transform: translateY(-1px);
    box-shadow: 0 16px 26px rgba(15, 122, 222, 0.26);
}

.lead-close-confirm__secondary {
    margin-top: 11px;
    background: transparent;
    color: #94A3B8;
    font-size: 13px;
}

.lead-close-confirm__secondary:hover {
    color: #64748B;
}

.lead-card__top {
    position: relative;
    background: linear-gradient(100deg, #0879dc 0%, #38BDF8 100%);
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.75rem, 3vw, 1rem) clamp(1rem, 5vw, 1.5rem);
    color: #ffffff;
}

.step-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.lead-card__progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-dot {
    display: block;
    flex: 0 0 auto;
    width: 21px;
    height: 4px;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.45);
    padding: 0;
    transition: background 0.2s ease, width 0.2s ease;
    cursor: pointer;
}

.progress-dot.is-active {
    width: 23px;
    background: #ffffff;
}

.form-step[hidden],
.success-state[hidden] {
    display: none;
}

.form-body {
    background: #ffffff;
    padding: clamp(1rem, 5vw, 1.9rem);
    overflow: visible;
}

.form-steps-container {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    width: 100%;
    overflow: hidden;
}

.form-step {
    grid-area: 1 / 1 / 2 / 2;
    width: 100%;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
}

.form-step[data-step="1"] {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.form-step[data-step="2"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    pointer-events: none;
}

.is-step-2 .form-step[data-step="1"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-20px);
    pointer-events: none;
}

.is-step-2 .form-step[data-step="2"] {
    position: relative;
    inset: auto;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.form-group-space {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.anunc-input {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #BFDBFE;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1E293B;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.anunc-input::placeholder {
    color: #94A3B8;
}

.anunc-input:focus {
    border-color: #0F7ADE;
    box-shadow: 0 0 0 4px #DBEAFE;
}

.anunc-input.is-invalid {
    border-color: #ef4444 !important;
    background: #fff7f7;
}

.anunc-btn-submit {
    margin-top: 1.5rem;
    width: 100%;
    border-radius: 9999px;
    background-color: #0F7ADE;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 800;
    color: #ffffff;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2), 0 4px 6px -4px rgba(59, 130, 246, 0.2);
    transition: transform 0.15s ease, background-color 0.15s ease;
    cursor: pointer;
}

.anunc-btn-submit:hover {
    transform: translateY(-0.125rem);
    background-color: #2563EB;
}

.anunc-btn-submit:focus {
    outline: none;
    box-shadow: 0 0 0 4px #BFDBFE;
}

.anunc-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Custom select */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select.is-open {
    z-index: 1000;
}

.custom-select__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    background: #fff;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #94A3B8;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-select.has-value .custom-select__trigger {
    color: #1e293b;
}

.custom-select.is-invalid .custom-select__trigger {
    border-color: #ef4444 !important;
    background: #fff7f7;
}

.custom-select__trigger:focus,
.custom-select.is-open .custom-select__trigger {
    border-color: #0F7ADE;
    box-shadow: 0 0 0 4px rgba(15, 122, 222, 0.1);
    outline: none;
}

.custom-select__chevron {
    flex-shrink: 0;
    color: #94A3B8;
    transition: transform 0.2s ease;
}

.custom-select.is-open .custom-select__chevron {
    transform: rotate(180deg);
}

.custom-select__list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #BFDBFE;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    padding: 6px;
    list-style: none;
    margin: 0;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.custom-select.is-open .custom-select__list {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.custom-select__list li {
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.custom-select__list li:hover {
    background: #EFF6FF;
    color: #0F7ADE;
}

.custom-select__list li.is-selected {
    background: #EFF6FF;
    color: #0F7ADE;
    font-weight: 700;
}

/* Overflow fix when select is open */
.lead-form:has(.custom-select.is-open),
.form-body:has(.custom-select.is-open),
.form-steps-container:has(.custom-select.is-open),
.form-step:has(.custom-select.is-open),
.lead-modal-wrapper:has(.custom-select.is-open) {
    overflow: visible !important;
}

/* Field errors */
.field-error {
    display: block;
    margin-top: 5px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
}

/* Success state */
.anunc-success-state {
    border-radius: 0.75rem;
    border: 1px solid #A7F3D0;
    background-color: #ECFDF5;
    padding: 1.5rem 1.25rem;
    text-align: center;
}

.anunc-success-icon-wrap {
    margin-left: auto;
    margin-right: auto;
    display: flex;
    height: 3rem;
    width: 3rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: #D1FAE5;
    color: #059669;
}

.anunc-success-title {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 800;
    color: #047857;
}

.anunc-success-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    color: #047857;
}

/* Error state */
.anunc-error-state {
    margin-top: 1rem;
    border-radius: 0.5rem;
    background-color: #FFF1F2;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #E11D48;
}

/* Footer */
.anunc-form-footer {
    margin-top: 0.85rem;
    margin-left: 0;
    margin-right: auto;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 380px;
    justify-content: center;
    gap: 1.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #64748B;
}

@media (min-width: 640px) {
    .anunc-form-footer {
        font-size: 0.75rem;
    }
}

.anunc-form-footer-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
