/* PMI HomeV2 — modals.css */
/* Full-screen overlay modals, slide-up animation, orange accents, form fields */

.v2-modals-container, .v2-modals-container *, .v2-modals-container *::before, .v2-modals-container *::after { box-sizing: border-box; margin: 0; padding: 0; }

.elementor-widget-pmiv2_modals .elementor-widget-container { padding: 0 !important; margin: 0 !important; }

/* Modal base */
.v2-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    padding: 20px;
}

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

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

.v2-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13,21,48,0.75);
    backdrop-filter: blur(3px);
    cursor: pointer;
    animation: backdropIn 0.25s ease both;
}

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

.v2-modal__box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.22);
    animation: modalSlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
    scroll-behavior: smooth;
}

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

.v2-modal__box::-webkit-scrollbar { width: 4px; }
.v2-modal__box::-webkit-scrollbar-track { background: #f3f4f6; }
.v2-modal__box::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.v2-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    z-index: 2;
}

.v2-modal__close:hover { background: #f97316; color: #fff; transform: scale(1.1); }
.v2-modal__close:focus-visible { outline: 2px solid #f97316; outline-offset: 2px; }

.v2-modal__header {
    padding: 32px 32px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.v2-modal__label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #f97316;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.v2-modal__title {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.v2-modal__sub {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

.v2-modal__form {
    padding: 24px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.v2-modal__row { display: flex; gap: 14px; }
.v2-modal__row--2 > * { flex: 1; min-width: 0; }

.v2-modal__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.v2-modal__label-field {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.v2-modal__label-field span { color: #f97316; }

.v2-modal__input,
.v2-modal__select,
.v2-modal__textarea {
    width: 100%;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 13px;
    font-size: 13px;
    font-weight: 400;
    color: #111827;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.v2-modal__input:focus,
.v2-modal__select:focus,
.v2-modal__textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
    background: #fff;
}

.v2-modal__input::placeholder,
.v2-modal__textarea::placeholder { color: #9ca3af; }

.v2-modal__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.v2-modal__textarea { resize: vertical; min-height: 80px; }

.v2-modal__submit {
    background: #f97316;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 13px 24px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    letter-spacing: 0.02em;
    margin-top: 4px;
}

.v2-modal__submit:hover {
    background: #ea6c0a;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(249,115,22,0.35);
}

.v2-modal__submit:active { transform: translateY(0); }
.v2-modal__submit:focus-visible { outline: 2px solid #0f2d58; outline-offset: 3px; }

.v2-modal__submit.is-loading {
    opacity: 0.75;
    pointer-events: none;
    position: relative;
}

.v2-modal__submit.is-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes btnSpin { to { transform: rotate(360deg); } }

.v2-modal__disclaimer {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    line-height: 1.5;
}

/* Success state */
.v2-modal__success {
    padding: 48px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    animation: successPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes successPop {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

.v2-modal__success[hidden] { display: none; }

.v2-modal__success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(249,115,22,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.v2-modal__success h3 {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

.v2-modal__success p {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.65;
    max-width: 340px;
}

/* Body lock when modal open */
body.pmiv2-modal-open { overflow: hidden; }

@media (max-width: 640px) {
    .v2-modal { padding: 0; align-items: flex-end; }
    .v2-modal__box { border-radius: 16px 16px 0 0; max-height: 92vh; }
    .v2-modal__header { padding: 24px 20px 16px; }
    .v2-modal__form { padding: 18px 20px 28px; }
    .v2-modal__row--2 { flex-direction: column; gap: 14px; }
    .v2-modal__title { font-size: 19px; }
}

@media (max-width: 420px) {
    .v2-modal__header { padding: 20px 16px 14px; }
    .v2-modal__form { padding: 16px 16px 24px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
