/* --- RESET GENERAL --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #1e293b;
    padding: 20px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* --- CONTENEDOR PRINCIPAL --- */
.form-container {
    background-color: #ffffff;
    max-width: 850px;
    width: 100%;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* --- CABECERA Y LOGO --- */
.logo-container {
    text-align: center;
    margin-bottom: 25px;
}

.app-logo {
    max-width: 160px;
    height: auto;
    object-fit: contain;
}

h2 {
    color: #0f172a;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 30px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    text-align: center;
}

/* --- BLOQUES Y DISEÑO (GRID RESPONSIVE) --- */
.form-section {
    margin-bottom: 10px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

/* --- ETIQUETAS E INPUTS --- */
label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #334155;
    background-color: #fff;
    outline: none;
    transition: all 0.2s ease-in-out;
    appearance: none;
    -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

input.readonly {
    background-color: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
}

/* --- BOTONES --- */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 35px;
    border-top: 1px solid #e2e8f0;
    padding-top: 25px;
}

input.acortar{
    width: 150px !important;
}

input.agrandar{
    width: 100% !important;
}

button {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: 6px;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-submit {
    background-color: #2563eb;
    color: #ffffff;
}

.btn-submit:hover {
    background-color: #1d4ed8;
}

.btn-cancel {
    background-color: #ffffff;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.btn-cancel:hover {
    background-color: #f8fafc;
    color: #334155;
}

.btn-submit:disabled {
    background-color: #bdc3c7 !important;
    color: #7f8c8d !important;
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: none !important;
    transform: none !important;
}


/* --- PIE DE PÁGINA (CRÉDITOS) --- */
.web-footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
}

.web-footer a {
    color: #2563eb; 
    text-decoration: none;
    font-weight: 600;
}

.web-footer a:hover {
    text-decoration: underline;
}

/* --- (MEDIA QUERY) --- */
@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .form-container {
        padding: 24px 16px;
        border-radius: 8px;
    }

    h2 {
        font-size: 1.35rem;
        margin-bottom: 20px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 0px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    button {
        width: 100%;
        padding: 14px;
    }
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3; 
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
