/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.form-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 900px;
}

.form-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
}

/* Alertas */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Formulario */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 250px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

/* Inputs de texto y número */
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Contenedor de fecha */
.date-input-container {
    position: relative;
}

.date-input-container input[type="date"] {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.date-input-container input[type="date"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.date-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

/* Contenedor de select */
.select-container {
    position: relative;
}

.select-container select {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select-container select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    font-size: 12px;
}

/* Estilos para las opciones del select */
.select-container select option {
    color: #333;
    background-color: #fff;
    padding: 8px;
}

/* Placeholder para selects */
.select-container select option[value=""] {
    color: #999;
}

/* Botón Create */
.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-start;
}

.btn-create {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.btn-create:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.btn-create:active {
    transform: translateY(0);
}

.btn-create i {
    font-size: 12px;
}

/* Estados de validación */
.form-group input.error,
.form-group select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group input.success,
.form-group select.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        min-width: auto;
    }
    
    .form-title {
        font-size: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 15px;
    }
    
    .form-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    .btn-create {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
    }
}

/* Animaciones sutiles */
.form-group {
    transition: transform 0.2s ease;
}

.form-group:focus-within {
    transform: translateY(-2px);
}

/* Estilo adicional para mejorar la accesibilidad */
.form-group input:invalid:not(:focus):not(:placeholder-shown),
.form-group select:invalid:not(:focus) {
    border-color: #ffc107;
    background-color: #fff3cd;
}

/* Loading state para el botón */
.btn-create:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-create.loading::after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}