/**
 * UCASAL Forms — Base CSS
 * El theme puede overridear con clases más específicas.
 */

.ucasal-form-wrap {
    max-width: 100%;
}

.ucasal-form__fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ucasal-form__row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.ucasal-form__field {
    flex: 1 1 0;
    min-width: 0;
}

.ucasal-form__col--1  { flex-grow: 1;  }
.ucasal-form__col--2  { flex-grow: 2;  }
.ucasal-form__col--3  { flex-grow: 3;  }
.ucasal-form__col--4  { flex-grow: 4;  }
.ucasal-form__col--5  { flex-grow: 5;  }
.ucasal-form__col--6  { flex-grow: 6;  }
.ucasal-form__col--7  { flex-grow: 7;  }
.ucasal-form__col--8  { flex-grow: 8;  }
.ucasal-form__col--9  { flex-grow: 9;  }
.ucasal-form__col--10 { flex-grow: 10; }
.ucasal-form__col--11 { flex-grow: 11; }
.ucasal-form__col--12 { flex-grow: 12; }

.ucasal-form__field input[type="text"],
.ucasal-form__field input[type="email"],
.ucasal-form__field input[type="tel"],
.ucasal-form__field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.ucasal-form__field input:focus,
.ucasal-form__field select:focus {
    outline: none;
    border-color: #0073aa;
}

.ucasal-form__field--error input,
.ucasal-form__field--error select {
    border-color: #d63638;
}

.ucasal-form__error {
    color: #d63638;
    font-size: 12px;
    margin-top: 4px;
}

.ucasal-form__field select:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.6;
}

.ucasal-form__terms {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.ucasal-form__terms input[type="checkbox"] {
    margin-top: 2px;
}

.ucasal-form__submit {
    margin-top: 16px;
}

.ucasal-form__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 140px;
}

.ucasal-form__btn:hover {
    background: #005f8c;
}

.ucasal-form__btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ucasal-form__spinner svg {
    display: block;
}

.ucasal-form__message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.ucasal-form__message--success {
    background: #edfaef;
    color: #0a7c1a;
    border: 1px solid #b8e6bf;
}

.ucasal-form__message--error {
    background: #fef0f0;
    color: #d63638;
    border: 1px solid #f0b8b8;
}

/* phone con selector de país */
.ucasal-form__phone {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.ucasal-form__phone-country {
    flex-shrink: 0;
    padding: 10px 8px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    background: #f8f8f8;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.ucasal-form__phone-number {
    flex: 1;
    min-width: 0;
    border-radius: 0 4px 4px 0 !important;
}

.ucasal-form__phone-country:focus {
    outline: none;
    border-color: #0073aa;
}

.ucasal-form__field--error .ucasal-form__phone-country,
.ucasal-form__field--error .ucasal-form__phone-number {
    border-color: #d63638;
}

/* phone_ar */
.ucasal-form__phone-ar {
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 100%;
}

.ucasal-form__phone-ar-country {
    flex-shrink: 0;
    max-width: 90px;
    padding: 10px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #f8f8f8;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.ucasal-form__phone-ar-country:focus {
    outline: none;
    border-color: #0073aa;
}

.ucasal-form__phone-ar-area {
    width: 100px !important;
    flex-shrink: 0;
    padding: 10px 10px !important;
}

.ucasal-form__phone-ar-num {
    flex: 1;
}

.ucasal-form__help {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.ucasal-form__field--error .ucasal-form__phone-ar-country {
    border-color: #d63638;
}

.ucasal-form__field--error .ucasal-form__phone-ar-area,
.ucasal-form__field--error .ucasal-form__phone-ar-num {
    border-color: #d63638;
}

@media (max-width: 600px) {
    .ucasal-form__row {
        flex-direction: column;
    }

    .ucasal-form__field input[type="text"],
    .ucasal-form__field input[type="email"],
    .ucasal-form__field input[type="tel"],
    .ucasal-form__field select {
        font-size: 16px;
    }
}

/* Modal de confirmación */
.ucasal-form__confirm {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ucasal-form__confirm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.ucasal-form__confirm-box {
    position: relative;
    background: #04203C;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    max-width: 480px;
    width: 100%;
    padding: 24px;
    box-sizing: border-box;
    animation: ucasal-form__confirm-in 0.18s ease-out;
}

@keyframes ucasal-form__confirm-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ucasal-form__confirm-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.ucasal-form__confirm-message {
    font-size: 15px;
    line-height: 1.5;
    color: white;
    margin-bottom: 20px;
    word-wrap: break-word;
}

.ucasal-form__confirm-message a {
    color: white;
    text-decoration: underline;
}

.ucasal-form__confirm-actions {
    display: flex;
    flex-direction:row;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.ucasal-form__confirm-btn {
    width:auto!important;
    padding: 10px 22px;
    border-radius: 4px!important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer!important;
    border: 1px solid transparent!important;
    transition: background 0.2s, border-color 0.2s;
}

.ucasal-form__confirm-btn--cancel {
    background: #494949!important;
    color: white;
    border-color: #494949!important;
}

.ucasal-form__confirm-btn--cancel:hover {
    background: #e8e8e8!important;
}

.ucasal-form__confirm-btn--accept {
    background: #0073aa!important;
    color: #fff!important;
}

.ucasal-form__confirm-btn--accept:hover {
    background: #005f8c;
}

body.ucasal-form__confirm-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .ucasal-form__confirm-actions {
        flex-direction: column-reverse;
    }
    .ucasal-form__confirm-btn {
        width: 100%;
    }
}
