* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.form-container {
    background: white;
    border: 1px solid #000000;
    max-width: 900px;
    width: 100%;
    padding: 60px 40px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    text-align: center;
    margin-bottom: 50px;
}

.logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin-bottom: 30px;
}

.header h1 {
    color: #000000;
    font-size: 1.5em;
    margin-bottom: 10px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logout-footer {
    margin-top: 30px;
    text-align: center;
}

.logout-button {
    padding: 10px 24px;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #ffffff;
    color: #000000;
    border: 1px solid #000000;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.logout-button:hover {
    background: #000000;
    color: #ffffff;
}

.header p {
    color: #000000;
    font-size: 0.9em;
    font-weight: 300;
}

.form-group {
    margin-bottom: 35px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #000000;
    font-weight: 400;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #000000;
    background: transparent;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
    color: #000000;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-bottom: 2px solid #000000;
}

.form-group input[readonly] {
    color: #999999;
    border-bottom: 1px solid #cccccc;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.form-group input[readonly]:focus {
    border-bottom: 1px solid #cccccc;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-bottom-color: #000000;
    border-bottom-width: 2px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.error-message {
    color: #000000;
    font-size: 0.8em;
    margin-top: 5px;
    display: none;
    font-weight: 300;
}

.error-message.show {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: #000000;
    color: #ffffff;
    border: 1px solid #000000;
    font-size: 0.9em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    background: #ffffff;
    color: #000000;
}

.submit-btn:active {
    transform: none;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.submit-btn.loading {
    color: transparent;
}

.submit-btn.loading:hover {
    background: #000000;
    color: transparent;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.success-message {
    background: #000000;
    color: #ffffff;
    padding: 20px;
    border: 1px solid #000000;
    text-align: center;
    margin-top: 20px;
    display: none;
    font-weight: 300;
}

.success-message.show {
    display: block;
    animation: slideDown 0.5s ease;
}

.error-message-form {
    background: #ffffff;
    color: #000000;
    padding: 20px;
    border: 2px solid #000000;
    text-align: center;
    margin-top: 20px;
    display: none;
    font-weight: 300;
}

.error-message-form.show {
    display: block;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.required {
    color: #000000;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 12px;
    padding-right: 25px;
    appearance: none;
}

.checkbox-group {
    margin-top: 20px;
    margin-bottom: 10px;
}

.form-group-checkboxes {
    margin-bottom: 40px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    cursor: pointer;
    font-weight: 300;
    font-size: 0.95em;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1;
}

.checkbox-label span {
    line-height: 22px;
    display: inline-block;
    vertical-align: middle;
}

.checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    margin-right: 15px;
    margin-top: 0;
    margin-bottom: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid #000000;
    background: #ffffff;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
    box-sizing: border-box;
    vertical-align: middle;
}

.checkbox-label input[type="checkbox"]:hover {
    border-color: #333333;
    background: #f9f9f9;
}

.checkbox-label input[type="checkbox"]:checked {
    background: #000000;
    border-color: #000000;
}

.checkbox-label input[type="checkbox"]:checked:hover {
    background: #000000;
    border-color: #000000;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #ffffff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.checkbox-label span {
    flex: 1;
    line-height: 1.5;
    color: #000000;
}

/* Estilos para carga masiva */
.drop-area {
    border: 2px dashed #000000;
    border-radius: 4px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
    margin-top: 10px;
}

.drop-area:hover,
.drop-area.dragover {
    background: #f5f5f5;
    border-color: #333333;
}

.drop-area.file-selected {
    border-color: #000000;
    background: #f9f9f9;
}

.drop-area-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.drop-area-content svg {
    color: #000000;
    stroke: #000000;
}

.drop-area-text {
    color: #000000;
    font-size: 0.95em;
    margin: 0;
}

.drop-area-link {
    color: #000000;
    text-decoration: underline;
    font-weight: 500;
}

.drop-area-filename {
    color: #666666;
    font-size: 0.85em;
    margin-top: 5px;
    font-weight: 400;
}

.mapeo-container {
    margin-top: 30px;
    padding: 30px;
    border: 1px solid #000000;
    background: #ffffff;
}

.mapeo-title {
    color: #000000;
    font-size: 1.2em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.mapeo-description {
    color: #666666;
    font-size: 0.9em;
    margin-bottom: 25px;
    line-height: 1.5;
}

.mapeo-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mapeo-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: center;
}

.mapeo-label {
    color: #000000;
    font-weight: 400;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mapeo-select {
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #000000;
    background: transparent;
    font-size: 1em;
    color: #000000;
    font-family: inherit;
    cursor: pointer;
}

.mapeo-select:focus {
    outline: none;
    border-bottom: 2px solid #000000;
}

.progress-container {
    margin-top: 30px;
    padding: 30px;
    border: 1px solid #000000;
    background: #ffffff;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: #000000;
    font-size: 0.9em;
}

.progress-bar {
    width: 100%;
    height: 30px;
    border: 2px solid #000000;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar-fill {
    height: 100%;
    background: #000000;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    gap: 30px;
    color: #000000;
    font-size: 0.9em;
}

.progress-stats strong {
    font-weight: 500;
}

.resumen-container {
    margin-top: 30px;
    padding: 30px;
    border: 1px solid #000000;
    background: #ffffff;
}

.aviso-prueba {
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #000000;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    font-size: 0.95em;
}

.resumen-title {
    color: #000000;
    font-size: 1.2em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.resumen-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.resumen-stat {
    padding: 20px;
    border: 1px solid #000000;
    text-align: center;
}

.resumen-stat.success {
    background: #f5f5f5;
}

.resumen-stat.error {
    background: #ffffff;
}

.resumen-label {
    display: block;
    color: #000000;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.resumen-value {
    display: block;
    color: #000000;
    font-size: 2em;
    font-weight: 400;
}

.resumen-desglose {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #cccccc;
}

.resumen-item {
    display: block;
    color: #000000;
    font-size: 0.85em;
    font-weight: 300;
}

.resumen-item strong {
    font-weight: 500;
    color: #000000;
}

.resumen-item.nuevo {
    color: #006600;
}

.resumen-item.actualizado {
    color: #0066cc;
}

.errores-detalle {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #cccccc;
}

.errores-detalle h3 {
    color: #000000;
    font-size: 1em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.errores-detalle ul {
    list-style: none;
    padding: 0;
}

.errores-detalle li {
    color: #000000;
    font-size: 0.9em;
    padding: 8px 0;
    border-bottom: 1px solid #eeeeee;
}

.errores-detalle li:last-child {
    border-bottom: none;
}

/* Modal de confirmación */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #ffffff;
    border: 2px solid #000000;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: #000000;
    font-size: 1.3em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
}

.confirm-info {
    margin-bottom: 25px;
}

.confirm-info p {
    color: #000000;
    font-size: 0.95em;
    margin-bottom: 15px;
    line-height: 1.6;
}

.confirm-info strong {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confirm-info ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 20px;
}

.confirm-info li {
    color: #000000;
    font-size: 0.9em;
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}

.confirm-info li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #000000;
}

.confirm-question {
    color: #000000;
    font-size: 1.1em;
    font-weight: 500;
    text-align: center;
    margin: 25px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn-cancel,
.btn-confirm {
    padding: 12px 30px;
    font-size: 0.9em;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #000000;
    font-family: inherit;
}

.btn-cancel {
    background: #ffffff;
    color: #000000;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.btn-confirm {
    background: #000000;
    color: #ffffff;
}

.btn-confirm:hover {
    background: #333333;
}

@media (max-width: 600px) {
    .mapeo-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .resumen-stats {
        grid-template-columns: 1fr;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .btn-cancel,
    .btn-confirm {
        width: 100%;
    }
}
