/* Estilos para el formulario de contacto */

/* Mensajes de respuesta */
.contact-message {
    margin-bottom: 20px;
    padding: 0;
    border-radius: 5px;
    display: none;
    animation: slideInDown 0.5s ease-out;
}

.contact-message.success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: 1px solid #4CAF50;
    color: white;
}

.contact-message.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    border: 1px solid #f44336;
    color: white;
}

.message-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    position: relative;
}

.message-content i:first-child {
    font-size: 18px;
    margin-right: 10px;
    flex-shrink: 0;
}

.message-content span {
    flex: 1;
    font-weight: 500;
}

.message-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    margin-left: 10px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.message-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Campos del formulario */
.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-control {
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
    width: 100%;
}

/* Estilos específicos para select */
select.form-control {
    height: auto;
    line-height: 1.4;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23666' d='m2 0-2 2h4zm0 5 2-2h-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
}

select.form-control:focus {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%238bc34a' d='m2 0-2 2h4zm0 5 2-2h-4z'/%3E%3C/svg%3E");
}

/* Estilos para select con valor seleccionado */
select.form-control.has-value {
    color: #333;
    font-weight: 500;
}

select.form-control option {
    color: #333;
    background-color: #fff;
    padding: 10px;
}

select.form-control option:first-child {
    color: #999;
    font-style: italic;
}

.form-control:focus {
    border-color: #8bc34a;
    box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.1);
    outline: none;
}

/* Campos con error */
.form-control.error {
    border-color: #f44336;
    background-color: #ffeaa7;
}

.form-control.error:focus {
    border-color: #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

/* Mensajes de error de campo */
.field-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    font-weight: 500;
    animation: fadeInUp 0.3s ease-out;
}

.field-error:before {
    content: "⚠ ";
    margin-right: 3px;
}

/* Botón de envío */
.btn-submit {
    background: linear-gradient(135deg, #8bc34a, #689f38);
    border: none;
    color: white;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #689f38, #558b2f);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 195, 74, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-submit.loading {
    background: #666;
    cursor: wait;
}

.btn-submit.loading:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

/* Estilos modernos para inputs y selects */
.modern-input,
.modern-select,
.modern-textarea {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    box-shadow: none;
    height: auto;
}

.modern-input:focus,
.modern-select:focus,
.modern-textarea:focus {
    border-color: #8bc34a;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.1);
    outline: none;
}

.modern-input::placeholder,
.modern-select option:first-child,
.modern-textarea::placeholder {
    color: #6c757d;
    font-style: italic;
}

.modern-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

.modern-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Estilos para labels */
.form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animaciones */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }
    to {
        transform: rotate(1turn);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .form-control {
        padding: 10px 12px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .btn-submit {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
    
    .message-content {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .modern-input,
    .modern-select,
    .modern-textarea {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 10px 12px;
    }
}

/* Mejoras de accesibilidad */
.form-control:focus,
.btn-submit:focus {
    outline: 2px solid #8bc34a;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .contact-message,
    .field-error,
    .form-control,
    .btn-submit {
        animation: none;
        transition: none;
    }
}
