/* ==========================================================================
   FORMULARIOS
   Estilos para formularios de contacto y otros
   ========================================================================== */

/* ----------------------------------------
   FORM CONTROLS BASE
   ---------------------------------------- */
.form-control {
    height: auto;
    padding: 0.75rem 1rem;
    font-family: var(--fe-font-primary);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--fe-text-dark);
    background-color: var(--fe-bg-white);
    border: 2px solid var(--fe-border-color);
    border-radius: var(--fe-border-radius);
    transition: border-color var(--fe-transition), box-shadow var(--fe-transition);
}

.form-control:focus {
    border-color: var(--fe-primary);
    box-shadow: 0 0 0 3px rgba(127, 190, 65, 0.15);
    outline: 0;
}

.form-control::placeholder {
    color: var(--fe-text-muted);
    opacity: 0.7;
}

/* Textarea */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ----------------------------------------
   FORM LABELS
   ---------------------------------------- */
.form-label {
    color: var(--fe-text-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.form-label.required::after {
    content: '*';
    color: var(--fe-danger);
    margin-left: 0.25rem;
}

/* ----------------------------------------
   INPUT GROUPS
   ---------------------------------------- */
.input-group {
    position: relative;
}

.input-group-text {
    background-color: var(--fe-bg-light);
    border: 2px solid var(--fe-border-color);
    border-right: none;
    color: var(--fe-text-muted);
    padding: 0.75rem 1rem;
}

.input-group .form-control {
    border-left: none;
}

.input-group .form-control:focus {
    z-index: 1;
}

.input-group:focus-within .input-group-text {
    border-color: var(--fe-primary);
}

/* ----------------------------------------
   SELECT
   ---------------------------------------- */
.form-select {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-family: var(--fe-font-primary);
    font-size: 1rem;
    font-weight: 500;
    color: var(--fe-text-dark);
    background-color: var(--fe-bg-white);
    border: 2px solid var(--fe-border-color);
    border-radius: var(--fe-border-radius);
    cursor: pointer;
    transition: border-color var(--fe-transition), box-shadow var(--fe-transition);
}

.form-select:focus {
    border-color: var(--fe-primary);
    box-shadow: 0 0 0 3px rgba(127, 190, 65, 0.15);
    outline: 0;
}

/* ----------------------------------------
   CHECKBOX Y RADIO
   ---------------------------------------- */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding-left: 0;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.15rem;
    border: 2px solid var(--fe-border-color);
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
}

.form-check-input:checked {
    background-color: var(--fe-primary);
    border-color: var(--fe-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(127, 190, 65, 0.15);
    border-color: var(--fe-primary);
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-label {
    color: var(--fe-text-dark);
    font-weight: 500;
    cursor: pointer;
}

/* ----------------------------------------
   VALIDACIÓN
   ---------------------------------------- */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--fe-danger);
    background-image: none;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--fe-danger);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--fe-success);
    background-image: none;
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: var(--fe-success);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

.invalid-feedback {
    display: none;
    color: var(--fe-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.valid-feedback {
    display: none;
    color: var(--fe-success);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Clase del Blazor original */
.validation-message {
    color: var(--fe-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.invalid {
    outline: 2px solid var(--fe-danger);
    border-color: var(--fe-danger);
}

/* ----------------------------------------
   FLOATING LABELS
   ---------------------------------------- */
.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 4px);
    padding: 1rem 1rem;
}

.form-floating > label {
    padding: 1rem;
    color: var(--fe-text-muted);
    font-weight: 500;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--fe-primary);
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* ----------------------------------------
   FORMULARIO DE CONTACTO
   ---------------------------------------- */
.contact-form {
    background: var(--fe-bg-white);
    padding: 2rem;
    border-radius: var(--fe-border-radius-lg);
    box-shadow: var(--fe-shadow);
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form .btn-submit {
    width: 100%;
    padding: 0.875rem 2rem;
}

/* ----------------------------------------
   RESPONSIVE
   ---------------------------------------- */
@media (max-width: 767.98px) {
    .contact-form {
        padding: 1.5rem;
    }
}

/* ----------------------------------------
   RECAPTCHA — WIDGET
   ---------------------------------------- */

/* El iframe de Google es inline: arrastra el hueco de la linea base debajo del widget. */
.g-recaptcha {
    display: flex;
    justify-content: center;
    line-height: 0;
}

/* ----------------------------------------
   RECAPTCHA — PLACEHOLDER DE DESARROLLO
   ---------------------------------------- */
.recaptcha-placeholder {
    width: 300px;
    min-height: 74px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
}

.recaptcha-placeholder__inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.recaptcha-placeholder__icon {
    font-size: 1.5rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.recaptcha-placeholder__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.recaptcha-placeholder__title {
    font-family: 'Poppins', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.3;
}

.recaptcha-placeholder__hint {
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.3;
}
